Support » Plugin: Bootstrap for Contact Form 7 » Compatibility issue with CF7 4.8

  • Resolved Rumores

    (@rumores)


    Hi,
    It appears that Bootstrap for Contact Form 7 has major issue with Custom Form 7 4.8.

    Since CF7 4.7, ajax loader wasn’t showing up and now with 4.8 release, invalid required field aren’t highlighted and indication tips don’t display anymore.

    If this plugin developement still maintained, thanks to the author for fixing this.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Frontliner

    (@frontliner)

    +1 for this issue.

    Hope to see a new version soon?

    Thank you.

    hommealone

    (@hommealone)

    I can confirm this too. Having the same problem.

    Bootstrap for Contact Form 7 now seems to be loading an additional script:

    /wp-includes/js/jquery/jquery.form.min.js?ver=3.37.0

    which wasn’t loaded with earlier versions. Can this be causing the problem?

    • This reply was modified 4 years ago by hommealone.
    ivorules

    (@ivorules)

    same, used @rumores fix for the ajax loader

    but invalid required fields don’t know where start

    cheers

    hommealone

    (@hommealone)

    If you need to see the problem in action (in in-action) you can visit this page…

    (Site is under active development) You’ll need to log in:
    login: guest
    pw: thisisunderdevelopment

    http://www.ultra-seal.com/packaging/contact-ultraseal/

    Submit the form without filling anything in; required fields are not highlighted and no tips are displayed.

    If you are just reading this because you have the same problem, please post a reply noting as much, so that the plugin author sees that the problem is wide-spread.

    Fungafly

    (@fungafly)

    I’ve had the same problem as well and found a way to solve it without hacking either this plugin or CF7.

    It stems from the CF7 update which began using a new REST API for validating the fields. It returns a field wrapper class (span.wpcf7-form-control-wrap) that the script uses to find the field and display the resulting validation message. The CF7BS plugin does not use this class in its field group wrappers, and hence the messages are not displayed.

    To fix this, add this code to your theme’s functions.php:

    // BEGIN CF7BS validation messages hotfix
    
    function filter_cf7RestResponse( $response, $result ) {
    	// Quits processing if validation passed
    	if ( 'validation_failed' != $result['status'] )
    		return $response;
    	// Alters wrapper classes in every field
    	foreach ( $response['invalidFields'] as &$field ) {
    		$field['into'] = str_replace( 'span.wpcf7-form-control-wrap', '.form-group', $field['into'] );
    	}
    	// Done
    	return $response;
    }
    
    add_filter( 'wpcf7_ajax_json_echo', 'filter_cf7RestResponse', 10, 2 );
    
    // END CF7BS validation messages hotfix

    It alters the wrapper class in the REST response to the class used by this plugin (.form-group).

    noex2global

    (@noex2global)

    Using Version 1.4.2 of Bootstrap for Contact Form 7 and using Contact Form 7 Version 4.8, it does not render anything on my contact us page. When I deactivate Bootstrap for Contact Form 7 everything works fine, any idea when there will be an update ? Running WP Version 4.8

    hommealone

    (@hommealone)

    @fungafly:
    Thanks; your hotfix seems to be working for me. Hopefully the plugin author will be able to incorporate some version of this into the plugin soon.

    @noex2global:
    The problem you describe doesn’t sound like the same one that this thread is about. I’d advise that you start your own thread if you still haven’t found an answer to your question.

    I’ve used @fungafly ‘s hotfix successfully on sites where I’d already updated CF7, but have been holding off on other sites, hoping I could simply wait on updating CF7 until the Bootstrap for Contact Form 7 plugin was updated to fix this issue…

    Does anyone have any info on when Bootstrap for Contact Form 7 will be updated to fix this conflict?

    Plugin Author Felix Arntz

    (@flixos90)

    This is fixed in version 1.4.3.

    Thanks a lot Felix! (@flixos90)

    And of course, thanks for your terrific plugin!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Compatibility issue with CF7 4.8’ is closed to new replies.