[Plugin: Contact Form 7] Break on error (17 posts)

  1. Rics1983
    Posted 6 years ago #

    Hi, i've searched over the forum and google before requesting help.
    I've included contact form 7 on a template that i'm developing and with firebug i got this error message:

    Break on Error
    _wpcf7 is not defined

    This error refer to line19 of "scripts.js" :

    if (_wpcf7.cached) {

    Here's a link to the firebug screenshot:


    I can't solve this problem myself, can someone help me?

    Thank you,


  2. Rics1983
    Posted 6 years ago #

    Forgot to report my functions.php file:

    if( !is_admin()){
       wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"), false, '1.4.2');
    if( !is_admin()){
       wp_register_script('jqueryUi', ("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"), false, '1.8.0');
    <?php if ( function_exists('register_sidebar') ) register_sidebar(); ?>
  3. Takayuki Miyoshi
    Posted 6 years ago #

    What happens if you remove the functions.php?

  4. Rics1983
    Posted 6 years ago #

    If i remove the functions.php the problem still remains.

    I work with it offline using mamp on mac osx, don't know if it is related.
    All the permissions are 755 for the plugins folder and for my theme folder.

    Perhaps i've to set something on MAMP?

    I'm sorry for my low knowledge, i'm learning wordpress! ;)

  5. Rics1983
    Posted 6 years ago #

    Double post.

  6. Takayuki Miyoshi
    Posted 6 years ago #

    MAMP is no problem. Try deactivating other plugins AND switching to the default theme to rule out problems possibly caused by them.

  7. richoid
    Posted 6 years ago #

    I'm having this as well. It's on a shared hosting environment. I developed the template, from the 'Default' template... I don't think I've messed anything up. The only other active plugin is Akismet. WordPress 2.9.2 and CF7's latest.

  8. Rics1983
    Posted 6 years ago #

    Well, i'm sorry that i've not replied in these last days, i've found that using an almost empty theme with only the contact form code on the footer i've no errors.
    Late tonight or tomorrow i will start to cut out, one by one, pieces of my "buggy" theme to find what is going in conflict with the contact form.
    I suspect that can be something with the jquery libraries and plugins calls that i've both in the header and in the footer.
    As i'll find the problem source i will post it here!

  9. wjm
    Posted 6 years ago #

    I found a solution to this.
    it should work.

    //if (_wpcf7.cached) {
    if ( typeof(_wpcf7) != "undefined" && typeof(_wpcf7.cached) != "undefined") {

  10. Rics1983
    Posted 6 years ago #

    I had the project in hold for some days, was working on another one.
    The last things that i did are some changes to my theme on the scripts side, so i've now the contact form that says "email successfully sent"...but emails never arrives to my email box.
    I've checked carefully the email address on the CF7 backend settings over the "To" field and is a working email.
    I've tried also to change from a google one to an hotmail one address but same story, i don't receive emails.

    At the moment i can't say nothing about the solution found by wjm until today late tomorrow, when i will work on this project.
    Also later i will try to explain my changes to the theme that solved the "undefined function" issue.

  11. wjm
    Posted 6 years ago #

    my solution only fixes the javascript error message, but despite this error message it will send the message successfully. so those line wont solve your issue

  12. Rics1983
    Posted 6 years ago #

    I've all working fine about scripts etc, firebug don't report errors.
    But the mail isn't sent.

  13. Rics1983
    Posted 6 years ago #

    Here i am!
    I'm working also to another website, this one is a wp ecommerce website developed using shopp plugin.
    I've included in a page a contactform7 email form without captcha and all is working fine, no-errors and email arrives correctly.
    As installed plugins i've only contactform7 and Shopp.

    I will investigate later on the other website that is causing me problems on sending emails to see if is something related with captcha or other scripts/plugins.

  14. Rics1983
    Posted 6 years ago #

    I've forgot an important difference:

    On the website that contactform7 is working i've placed the form in a page placing the shortcode:

    [contact-form 1 "Modulo di contatto 1"]

    On the website that contactform7 isn't sending emails i've placed the form on the footer using the following code:

    <?php echo do_shortcode( '[contact-form 1 "Modulo di contatto 1"]' ); ?>
  15. Rics1983
    Posted 6 years ago #

    Don't ask me how but now is all working fine for both websites, in the one that gave me problems i've only changed the form tags names.

    Don't know if the thread can be set to resolved because i've not at the moment a valid explanation.

  16. A2daK
    Posted 6 years ago #


    Thanks for this quickfix. I was finding it really annoying with firebug notifying me of this javascript error constantly while developing a site.

    Cheers WJM!

  17. lunarman9
    Posted 5 years ago #

    This is a problem with Firebug, not CF7. Firebug JS debug does not properly interpret try/catch loops and incorrectly assumes the program is broken. @wjm's solution "buries" the issue with firebug but will remove some functionality from CF7. The best way around this is to disable firebug's JS checker when developing, and ignore this case until the next version comes out that interprets try/catch loops properly.

Topic Closed

This topic has been closed to new replies.

About this Topic