Forums

[resolved] [Plugin: MM Forms] Form submission hangs (possibly after wpmu-2.9 update) (14 posts)

  1. never147
    Member
    Posted 2 years ago #

    Using the mm-forms plugin in wordpress multiuser v2.9.1.1 and recently possibly since the site has been upgraded from 2.8.6 to 2.9.1 form submissions are failing to complete. In tests I've ran the form data is stored in the database and emailed where applicable but the ajax complete image remains on the page and the form doesn't return the usual success message. I've had some users report they've completed a form but I've not received any data in the database or by email. Another possible new addition is an SSL certificate and the domain mapping plugin.

    Can anyone suggest where to start looking to resolve this? I've tried updating the plugin to 0.9.7b.

    http://wordpress.org/extend/plugins/mm-forms/

  2. chrisplaneta
    Member
    Posted 2 years ago #

    Same problem here. Checked on v2.9.1 and v2.8.5. On the first one everything hangs on pressing the submit button. In 2.8.5. it also hangs but the email is sent nevertheless. I checked it on new installation and with plugins with database lg set to once latin II and once to utf8. No change.
    If anybody has the same problem or knows how to resolve it just post it here.

  3. chrisplaneta
    Member
    Posted 2 years ago #

    OK, so I have found the solution. It turned out that there was a conflict in my js file. I had an animation that was initiated on pressing the submit button. I just had to get rid of the animation on submit button and voilea:) Everything works just fine!

  4. never147
    Member
    Posted 2 years ago #

    Hi Chrisplaneta. I've tried commenting out the ajax-loader.gif from the $html concatenation in the mm-forms.php which has made the animating gif disappear from the form but it still fails to change to the finished page. I do however get the email through. Can you post a diff or explain in more detail what you did?

    Thanks!

  5. chrisplaneta
    Member
    Posted 2 years ago #

    Sure thing. As I have already said my Javascript (JQuery) file was to blame. If you have written any javascript to perform actions on your site, check if it targets any submit button. If it does just then try to correct it or simply disable the whole file to check whether it is to blame. If it doesn't work than I really don't know. My only advice would be to start a fresh installation (with no themes or plugins) and then to enable one plugin at a time and check when the forms stop working. It should at least give you the idea what is causing the error. And then, hopefully, make it work:)

  6. never147
    Member
    Posted 2 years ago #

    Thanks for that chrisplaneta.

    I've setup a separate new blog on our wordpress MU with no plugins and enabled mm forms with the default contact form and I got the same problem.

    Did the same thing with a standalone instance of wordpress and it works fine. So a WPMU problem?

    I'll have another play. Thanks for your help.

  7. pdclark
    Member
    Posted 2 years ago #

    I'm having a similar problem with MM-Forms AJAX hanging in WPMU 2.9.1 / MMF 0.9.7b.

    After having no luck fixing the failed AJAX call on any consistent basis, I instead disabled MMF's AJAX function by putting this code in my theme's functions.php:

    add_action('template_redirect', 'pd_disable_mmf_ajax');
    
    function pd_disable_mmf_ajax() {
    	global $mmf;
    
    	// Remove MMF's wp_head function
    	remove_action('wp_head', array(&$mmf, 'wp_head'));
    
    	// Enqueue MMF CSS & Calendar js
    	wp_enqueue_style('pd_mmf', WP_PLUGIN_URL.'/mm-forms/stylesheet.css');
    	wp_enqueue_style('pd_mmf_cal', WP_PLUGIN_URL.'/mm-forms/calendar.css');
    	wp_enqueue_script('pd_mmf_cal_js', WP_PLUGIN_URL.'/mm-forms/calendar.js');
    }
  8. never147
    Member
    Posted 2 years ago #

    pdclark you a legend! =] Copied this into my theme and it allows the form to complete. I am a happy bunny =]

  9. kolucciy
    Member
    Posted 2 years ago #

    I have the same problem. However I found out that in Firefox it works just fine, but in IE8 data is not being saved to DB.

  10. kolucciy
    Member
    Posted 2 years ago #

    I found out what was the problem. There is a field client_browser which has type VARCHAR with up to 200 chars limit. In my case $_SERVER['HTTP_USER_AGENT'] was more then 200 chars and it was causing problems. I've just increased the limit for this field and it solved my problem, now data is saving correctly in all browsers.

  11. kolucciy
    Member
    Posted 2 years ago #

    Sorry, forgot to mention the table name: wp_contactform_submit

  12. levent.curtasan
    Member
    Posted 1 year ago #

    Hey guys, I've had the same problem and after a lot of digging I found the cause. This plugin is not compatible with jQuery 1.4, so if you want AJAX to work you need to use the older version, 1.3.2. Just add this in your functions.php

    function initialize() {
    if (!is_admin()) {
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.3.2');
    wp_enqueue_script('jquery');
    }
    }
    add_action('init', 'initialize');
  13. roberthq
    Member
    Posted 1 year ago #

    pdclark - yeah, work like a charm Thanks!
    RRG

  14. kolucciy
    Member
    Posted 1 year ago #

    As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. So, just fix this function: ajax_json_echo (line 162 to 187) from mm-forms.php to make the plugin compatible with the latest version of jQuery.

    To do so, just enclose all the generated JSON properties in double-quotes.

    Example:

    Replace:
    echo '{mailSent: 0, message: "' . js_escape($this->message('mail_data_saved')) . '", into: "#' . $unit_tag . '", captcha: ' . $captcha . ' }';

    With:
    echo '{"mailSent": 0, "message": "' . js_escape($this->message('mail_data_saved')) . '", "into": "#' . $unit_tag . '", "captcha": ' . $captcha . ' }';

    Hope it helps ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags