• Resolved fijisunshine

    (@fijisunshine)


    Great plugin!

    I’ve used this plugin for years without any issues. Recently, I’ve had an issue that occurs if this plugin is enabled. The issue goes away if I disable this plugin.

    The issue is that when I try to submit any CF7 form, even those without any conditional fields, the form will not submit. The submit button doesn’t do anything when I click it. It won’t even display validation messages, such as those indicating that a field is required.

    Here are the errors I get when I click the submit button on a CF7 form:

    From the error log:

    PHP Warning: Undefined array key “_wpcf7cf_hidden_group_fields” in …/wp-content/plugins/cf7-conditional-fields/cf7cf.php on line 193
    PHP Warning: Undefined array key “_wpcf7cf_hidden_groups” in …/wp-content/plugins/cf7-conditional-fields/cf7cf.php on line 194
    PHP Warning: Undefined array key “_wpcf7cf_visible_groups” in …/wp-content/plugins/cf7-conditional-fields/cf7cf.php on line 195
    PHP Fatal error: Uncaught TypeError: array_diff(): Argument #1 ($array) must be of type array, null given in …/wp-content/plugins/cf7-conditional-fields/cf7cf.php:198

    From the browser console:

    XHR POST …/contact-form-7/v1/contact-forms/26109/feedback [HTTP/2 500 Internal Server Error 733ms]

    I’m running WordPress 5.6.2, PHP 8.0, CF7 5.3.2, and version 1.9.14 of this plugin.

    Any suggestions? Thank you

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Thanks for reporting.

    Could you create a minimal version of a form that fails for you and send me the source code? I want to make sure first that you get this error even for very simple forms

    • This reply was modified 3 years, 9 months ago by Jules Colle.
    • This reply was modified 3 years, 9 months ago by Jules Colle.
    Thread Starter fijisunshine

    (@fijisunshine)

    Hi Jules,

    Thank you for your reply. Yes, the error also exists on very simple forms. I created a form with just one field and a submit button:

    [text name]

    [submit “Submit”]

    and the error exists. Please note the “PHP Fatal error” in my prior message (above). Also, please note I’m using CF7 5.3.2.

    If you have any more questions, please let me know.

    Thanks again

    Plugin Author Jules Colle

    (@jules-colle)

    I think this is most likely a conflict with another plugin.. Could you check step 4. How to solve a server side problem?
    here https://conditional-fields-cf7.bdwm.be/docs/troubleshooting/does-not-work-with-a-third-party-theme-or-plugin/

    Sorry, I mean step 2.Figure out exactly which plugin or theme is causing a problem with Conditional Fields for Contact Form 7.

    You already did a superb job by giving me the detailed error message

    • This reply was modified 3 years, 9 months ago by Jules Colle.
    Thread Starter fijisunshine

    (@fijisunshine)

    Thank you, Jules.

    You’re right, it’s a conflict with the “Contact Form 7 Multi-Step Forms” plugin. If this plugin, or that plugin, is disabled then the issue is gone.

    I tried rolling back this plugin several version to see if that would fix it. It didn’t. I then tried rolling back that plugin several versions. But that didn’t fix it, either.

    Plugin Author Jules Colle

    (@jules-colle)

    Because it’s hard to guarantee compatibility with complex third party extensions like multistep and repeater fields, I have coded these myself, to guarantee compatibility with Conditional Fields. Multistep is available in CF pro https://conditional-fields-cf7.bdwm.be/multistep/

    However, take note that currently you will need to keep CF7 at version 5.3.2 because there is a conflict with version 5.4

    All that said, I do some compatibility tests with other popular CF7 extensions occasionally, but because of the vastness and complexity of some of these it’s practically impossible to maintain compatibility with all of them. It’s already hard enough to stay compatible with CF7. Everything is moving so fast, and with all these plugins trying to use the newest technologies, backwards compatibility is often something that’s being ignored completely.

    Thread Starter fijisunshine

    (@fijisunshine)

    Hi Jules,

    Ok, thanks for letting me know about the PRO version.

    FYI I reverted back to PHP 7.4 from PHP 8.0 and the issue disappeared. With PHP 7.4, there’s no conflict between the plugins.

    Plugin Author Jules Colle

    (@jules-colle)

    Thanks for letting me know. Will make sure to test with PHP 8.0. There’s probably an easy fix for it. Stay tuned for future updates.

    Thank you for this thread! I had the same submit button not doing anything and found that Contact Forum 7 to be the culprit.

    I updated our PHP version to 7.4 and deactivated CF7, downloaded the last revision 5.3.2 at the bottom of the page if anyone is looking for them (https://www.ads-software.com/plugins/contact-form-7/advanced/), cleared cache and the submit button and emails are back up!

    Thread Starter fijisunshine

    (@fijisunshine)

    Thank you, Jules. In the latest version of your plugin, the issue appears to be fixed.

    FYI @webheadllc provided some useful code as a temporary fix (although this code no longer seems necessary):

    https://www.ads-software.com/support/topic/conflicts-with-cf7-conditional-fields-plugin-in-php-8-0/

    Please read the entire topic to understand the correct code because the code snippets have mistakes in them. Perhaps the code will be useful to you in regards to PHP 8.0.

    Thanks again

    Thread Starter fijisunshine

    (@fijisunshine)

    Sorry, I spoke too soon. The issue is resolved but only when using @webheadllc’s suggested code in cf7cf.php near line 206:

    $cookie_data_hidden_group_fields = json_decode(stripslashes(isset($cookie_data['_wpcf7cf_hidden_group_fields']) ? $cookie_data['_wpcf7cf_hidden_group_fields'] : '[]'));
    $cookie_data_hidden_groups = json_decode(stripslashes(isset($cookie_data['_wpcf7cf_hidden_groups']) ? $cookie_data['_wpcf7cf_hidden_groups'] : '[]'));
    $cookie_data_visible_groups = json_decode(stripslashes(isset($cookie_data['_wpcf7cf_visible_groups']) ? $cookie_data['_wpcf7cf_visible_groups'] : '[]'));

    You can use this code as a guide for a future update regarding PHP 8.0

    Thanks again

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Submit button is unresponsive’ is closed to new replies.