Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms with conditional logic broken since GF 2.5.3 (fix included) #42

Open
elliott-w opened this issue Sep 10, 2021 · 1 comment
Open

Comments

@elliott-w
Copy link

elliott-w commented Sep 10, 2021

Since Gravity Forms 2.5.3, they made it so that form scripts are printed in the footer rather than in the form itself. This made it so that this plugin couldn't modify the form ids in the $form_string and thus broke the plugin. The fix is to make sure scripts always get printed inside the form itself:

add_filter('gform_init_scripts_footer', 'print_scripts_in_form');
function print_scripts_in_form($bool) {
  return false;
}

You can add that code snippet inside the __construct() function of the gf-multiple-form-instances.php file or inside your theme's functions.php file.

Also I'm not sure when the quotes were changed, but you should also change the line:
"id='field_" . $form['id'] . '_' => "id='field_" . $random_id . '_',
with:
'id="field_' . $form["id"] . "_" => 'id="field_' . $random_id . "_",

Also it seems the Google Recaptcha v3 add-on doesn't work for multiple instances of the same form on a single page. I would recommend disabling recaptcha specifically for those forms.

@TehKonnos
Copy link

Thank you very much! Indeed it works very good with conditional logic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants