I had a problem with a form in my cart where ajax was not properly triggered. Debug the problem and found a line of code in jquery.form.js where it crashed. After updating the file to version 3.5 ( http://malsup.github.io/jquery.form.js ) the problem was solved. Please consider this for future release.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

olteanu5000’s picture

Assigned: olteanu5000 » Unassigned
olteanu5000’s picture

Status: Needs work » Needs review
FileSize
63.4 KB
olteanu5000’s picture

FileSize
88.75 KB
thirdender’s picture

I recently had an issue as well… I'm still trying to nail down exactly what is causing the issue, but updating jquery.form.min.js as this patch does solved my problem.

Specifically, I was trying to set up an Entityform to submit AJAX-ly via the Ajax form entity module. Things should have been working great, except I immediately got the error An error occurred while attempting to process /system/ajax: undefined is not a function

I decided to dig at it a bit and started by disabling the jQuery Update module completely. The error persisted, so I turned to the JS debugger and started stepping through code. Everything was working fine until the code jumped into the CORE/misc/jquery.form.js file. I couldn't step through the minified code, so I replaced the contents with the unminified version from the github repo. The error went away…

After re-enabling the jQuery Update module the error re-appeared, and I found this patch. I'm pretty sure the error is solely in the jquery.form.js files in core and this module. However, I'm unfamiliar with exactly what the file is doing, so I can't comment further…

Hoping this message in a bottle finds someone who knows what to do with it :-p

markhalliwell’s picture

Closed #1675794: Update jquery.form.js - older versions break in IE8 in favor of this patch. I think this should be ok, but would like some more people to test and verify it doesn't break anything else before committing.

thirdender’s picture

The simplest test case I've found is enabling AJAX for any Webform. The AJAX-enabled Webform submission will fail with this error unless the patch is applied. Has anyone else run into this issue?

balazswmann’s picture

There is another issue reported for core's 7.x-dev, which can be traced back to the old jquery.form.js version. I suggested to use jQuery Update + the patch file attached in #3 to solve the problem.

markhalliwell’s picture

Status: Needs review » Needs work

Given that there is now an option to use core's default jQuery version (1.4.2), I think there should be a check to only include this update to jquery.form.js if the jQuery version is >= 1.5. jquery.form.js version 3.50 states that it requires this.

thirdender’s picture

The commit that bumped jQuery requirement from 1.3.2 to 1.5 is add support for deferreds. I think including either the default Drupal version or the latest version makes sense if a PHP check ensures that jQuery 1.5 is available, as Mark said. Alternatively, we could test the code right before that commit to see if it fixes the issues too. It looks like it's version 3.17, which is lower than the v3.5 reported to fix the issue by OP.

_grizly’s picture

Referring to #4, I had this problem too, with latest code, fixed on mine:

Path was set incorrectly, so instead of actually grabbing the file, it was using a "relative url" from where I was, which was deep in field settings..

Find sites/all/modules/jquery_update/jquery_update.module
Line 78, simply prepend: '/'. to drupal_get_path('modul...

So it should look like:

/**
 * Implements hook_library_alter().
 */
function jquery_update_library_alter(&$javascript, $module) {
  $path = '/'.drupal_get_path('module', 'jquery_update');
  $version = variable_get('jquery_update_jquery_version', '1.10');

Now the library (in this case, jquery.forms.min.js) was loaded correctly, and the page functioned perfectly!
Not sure why it would fail, when drupal_get_path is clearly the correct function to use (I've used it myself!), but in this case, nope. drupal_get_path strips the first / from the path, which we need in this case.

I suppose I should finally learn about patches.. :-|

thirdender’s picture

I'm not sure that's the correct fix… '/'<code> should be <code>base_path()<code>, and I think Drupal adds that part itself later. All the jquery_update module is doing at this point is altering the Drupal core library paths to point to it's own stored copies of the files. Does anyone else know if there is an issue with Drupal not using the correct <code>base_path() for defined libraries?

markhalliwell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
JordanMagnuson’s picture

Just wanted to chime in and confirm that updating jquery.form.js also fixes this core issue: Wrong submit values for multiple select under ajax submit.

pcho’s picture

So I just got around to solving a really nasty bug that had poor error reporting. After deploying several debugging tactics, I discovered that, in my specific case, Panels IPE relies heavily on the jquery.form.js, which seems to be defective when it comes to POSTing data via the multipart/form-data type (basically anything that requires uploading some binary file like images). This has caused the IPE, upon submission of the configuration form to break and yield the JSON meant for the iframe we typically post our data to to open in a new window.

Per the recommendation in #8, I also included a version check and split out the jquery.form.js versions into separate directories so we can toggle based on what jquery versions we're using.

http://cl.ly/image/360R2v0f3d2s

The issues I described has been fixed on my end. Will have others review this, but I really think we should get this patch included ASAP.

Note: Updated jquery.form.js to 3.51

pcho’s picture

Status: Needs work » Needs review
RobLoach’s picture

Can we just update the whole thing, rather than having a conditional for jQuery <=1.5?

  • RobLoach committed 52c2cf9 on 7.x-3.x
    Issue #2266303 by olteanu5000, pcho, markcarver, thirdender: Update...
RobLoach’s picture

Status: Needs review » Fixed

Committed this with some small modifications to 7.x-3.x-dev. Please feel free to test as needed and report back.

Status: Fixed » Closed (fixed)

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

martinpesout’s picture

Hello guys,

after update of Jquery Update module with newer jquery.form.js I have new problem in my current app. I reported it here https://www.drupal.org/node/2598906 You can see that I'm not the only one who has the same problem. Can you check it and help me how to solve it?

Thanks a lot