PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multi Site Validation Broken

  1. We've got a multi site installation with Gravity Forms. The two sites right now are English and Spanish. When you fill out a form on the Spanish site, and there are validation errors, the form from the English site is loaded in place of the original:

    http://briansandoval.com.php53-17.ord1-1.websitetestlink.com/es/voluntario/

    Check the 'email' field when you fill it out. It starts out as "Correo electrónico", but if there are errors on the form, the "Email" label is displayed.

    The forms do have the same ID, but they are not part of the same site on the network.

    EDIT:

    Looking a little closer, it looks like the action on the form is incorrect; it doesn't include the full domain (missing /es):

    <form method="post" enctype="multipart/form-data" target="gform_ajax_frame_5" id="gform_5" action="/voluntario/#gf_5">

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  2. David Peralty

    We have a Spanish translation here - http://www.gravityhelp.com/downloads/translations/ that allows you to translate all of Gravity Forms into Spanish. And the label change thing is really strange, I'm not sure why it would do that.

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  3. So it's not really a translation issue. It looks like it's an issue with the form action. I exported these forms from the English version and imported them into the Spanish version, could that be the issue?

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  4. David Peralty

    What are the URLs of both sites? Like I said, when I submitted it, the URL didn't change. Can you build another form on the spanish site and test it?

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  5. So here's a non-AJAX form on the Spanish site:
    http://briansandoval.com.php53-17.ord1-1.websitetestlink.com/es/test

    The action on the form is just /test. Which should work fine, but somehow it seems to be sending it to the main site domain:
    http://briansandoval.com.php53-17.ord1-1.websitetestlink.com/test
    Instead of:
    http://briansandoval.com.php53-17.ord1-1.websitetestlink.com/es/test

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  6. Here's a simpler one:

    http://briansandoval.com.php53-17.ord1-1.websitetestlink.com/es/test-2/

    Submitting it with validation errors redirects you to a 404 on the main site here:

    http://briansandoval.com.php53-17.ord1-1.websitetestlink.com/test-2/

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  7. David Peralty

    How do you have the Spanish site set-up? The form action should send the form to the page the form is on. Something is potentially wrong with your WordPress setting if this isn't the case.

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  8. It's just a site on the network. We're using subdirectories instead of subdomains. Main site is .com, and the Spanish site is .com/es/.

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  9. So I'm wondering now if it's an issue with add_query_arg(); .

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  10. It looks like that is the issue. When installed in a subdirectory, add_query_arg(); includes the name of the subdirectory. On multisite, however, when using subdirectories, it doesn't.

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  11. Yea, the problem is coming from the add_query_arg() function, but my subdirectory multi-site installs work fine, so I think this is something specific to your WP installation.
    I am looking at the add_query_arg() function and it seems to use the $_SERVER['REQUEST_URI'] variable. It might be helpful to print that variable out and see if it contains the expected value. Worst case scenario, you can use the gform_form_tag filter to change the action attribute manually. In that case try setting it to blank, and that might do the trick for you. Following is a code snippet that should help you get there. Paste it in your theme's functions.php file.

    add_filter("gform_form_tag", "form_tag", 10, 2);
    function form_tag($form_tag, $form){
        $form_tag = preg_replace("|action='(.*?)'|", "action='custom_handler.php'", $form_tag);
        return $form_tag;
    }
    Posted 10 years ago on Friday May 31, 2013 | Permalink

This topic has been resolved and has been closed to new replies.