On IE, with Clientside Validation 1.33 installed, any drupal form using ajax with clientside validation loaded into memory will fail on ajax.js's try/catch, and gives the error "An error occurred while processing /system/ajax:" with a blank error message. Downgrading to 1.31 solved the issue.

CommentFileSizeAuthor
#5 i1669960-5.png8.77 KBattiks
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks’s picture

Can you clarify "any drupal form using ajax with clientside validation loaded into memory will fail", do you mean with for example a file upload?

cviccaro’s picture

Sorry, should have been a bit more articulate. The reason I say "any drupal form with ajax will fail" is because every form, be it webform or FAPI, that included an #ajax property, would immediately throw a JS alert, and this is the block of code in ajax.js it is failing on:

try {
    if (ajax.form) {
      // If setClick is set, we must set this to ensure that the button's
      // value is passed.
      if (ajax.setClick) {
        // Mark the clicked button. 'form.clk' is a special variable for
        // ajaxSubmit that tells the system which element got clicked to
        // trigger the submit. Without it there would be no 'op' or
        // equivalent.
        element.form.clk = element;
      }

      ajax.form.ajaxSubmit(ajax.options);
    }
    else {
      ajax.beforeSerialize(ajax.element, ajax.options);
      $.ajax(ajax.options);
    }
  }
  catch (e) {
    // Unset the ajax.ajaxing flag here because it won't be unset during
    // the complete response.
    ajax.ajaxing = false;
    alert("An error occurred while attempting to process " + ajax.options.url + ": " + e.message);
  }

The execution reaches the call to ajaxSubmit ("ajax.form.ajaxSubmit(ajax.options)") where it fails, but the error message is blank. Additionally, at least in the limited capacity I have to console.log using IE, it seems the ajax JS object is fully initialized, and ajax.element and ajax.options are both defined.

It is odd!

attiks’s picture

Do you have an example form so we can test this?

cviccaro’s picture

Sure: http://common.jpecatalogs.com/drupal/ has a form that illustrates this bug on the front page. This site is a sandbox purely for testing purposes; I had moved the module that defined this specific form from a site we are building onto this sandbox to ensure I could replicate the same issue.

attiks’s picture

FileSize
8.77 KB

I tried this with IE9 and it's working, so what version of IE isn't working?
What version of Drupal are you using, 7.14?

I did a quick comparison between dev version and 1.31 version, most of the changes are comments, horizontal tab support, extra validators, ...

What I sometimes do see is the following, but this is a core bug (#811542: Regression: Required radios throw illegal choice error when none selected and probably not related:
i1669960-5.png

Can you provide me the code of that form so I can do some debugging?

cviccaro’s picture

You're right--it does work in IE9. IE7 & IE8 are where I am encountering this issue, even just switching to IE8 mode in IE9 F12 tools will replicate the issue. The form in question has some table data that I'd rather not transfer over, so here is a similar module developed side-by-side that shows the same issue: http://common.jpecatalogs.com/libs/drupal/roi_calculator.tar

attiks’s picture

This was fun to debug, apparently there's a bug inside jquery.form.js that's having trouble with the added prototype functions we add in clientside_validation.ie8.js, those were added to the ajax.options.data as well, but the jquey.form.js was having trouble with it.

Quick solution: download the new version from http://malsup.github.com/jquery.form.js and put in inside /misc

Can you try it and let me know if it works, if it does I'll try to find a way to add it from inside clientside_validation?

cviccaro’s picture

Well, I appreciate the work, and I can confirm this fixes the problem. I had to replace it at sites/all/modules/jquery_update/replace/misc, though, so perhaps only jquery_update needs modified/fixed and not clientside_validation.

attiks’s picture

Status: Active » Fixed

I added a new general setting to override the jquery.form.js version to v3.09, it works without the jquery_update module, but isn't tested when jquery_update is installed.

Issue opened against jquery_update: #1675794: Update jquery.form.js - older versions break in IE8

diggingrelic’s picture

I had the same issue and this fix worked for me. Thank you! I also replied in the issue against jquery_update.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sumaiyajaved’s picture

i replaced the jquery.form.js in my misc folder and do not have jquery_update as I am using drupal 7 but this did not solve the issue for me ... any help :( ??

dahousecat’s picture

Issue summary: View changes

I'm experiencing the same issue. I updated jquery.form.js but this did not solve the issue. Downgrading to 1.31 was the only solution that worked for me so just going to stick with that.