Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#14 | jquery_update-update_jqueryform_update-2266303-14.patch | 130.27 KB | pcho |
Comments
Comment #1
olteanu5000 CreditAttribution: olteanu5000 commentedComment #2
olteanu5000 CreditAttribution: olteanu5000 commentedComment #3
olteanu5000 CreditAttribution: olteanu5000 commentedComment #4
thirdender CreditAttribution: thirdender commentedI 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
Comment #5
markhalliwellClosed #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.
Comment #6
thirdender CreditAttribution: thirdender commentedThe 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?
Comment #7
balazswmann CreditAttribution: balazswmann commentedThere 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.
Comment #8
markhalliwellGiven 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.
Comment #9
thirdender CreditAttribution: thirdender commentedThe 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.Comment #10
_grizly CreditAttribution: _grizly commentedReferring 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:
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.. :-|
Comment #11
thirdender CreditAttribution: thirdender commentedI'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?Comment #12
markhalliwellComment #13
JordanMagnuson CreditAttribution: JordanMagnuson commentedJust 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.
Comment #14
pcho CreditAttribution: pcho commentedSo 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
Comment #15
pcho CreditAttribution: pcho commentedComment #16
RobLoachCan we just update the whole thing, rather than having a conditional for jQuery <=1.5?
Comment #18
RobLoachCommitted this with some small modifications to 7.x-3.x-dev. Please feel free to test as needed and report back.
Comment #20
martinpesout CreditAttribution: martinpesout commentedHello 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