Hi there.
Using Drupal 7.15. When I enable Clientside Validation, AJAX file uploads stop working, and return this error in a native browser alert: http://pastebin.com/tfEqHkTn (example when trying to "Delete" a previously uploaded image from a node).
It happens just after adding base Clientside Validation module component, without any of ther others components active. When I disable the module everything works fine. Error appears both in admin area and public forms that allow file uploads. Also happens both in testing (2) and production servers.
I'm using the AJAX component for other things (i.e: calendar month navigation) and it works flawlessly so I don't think it's an AJAX-related problem. File uploads work when AJAX is not used, sending the whole form instead of field-specific upload buttons.
Sadly I currently don't have the time to look at code and fix, but i'll be monitoring here if more information is needed. Sorry about that.
Comments
Comment #1
Jelle_SBug confirmed. Not sure what causes it. I'm looking in to it.
Comment #2
Jelle_SOk, very weird bug...
Do you by any chance have jquery_update enabled?
I had, and while it was enabled I got the error. Disabling either Clientside Validation or jquery_update 'fixed' the error.
I also found that commenting out hook_library_alter fixed the error (doesn't matter in which module I comment it out, works both for jquery_update as for Clientside Validation)
Setting "Use jquery.form.js version 3.09" to "No" at admin/config/validation/clientside_validation/general also fixes it.
Then I started digging a little deeper and commenting out just these lines in jquery_update_library_alter also fixes it:
So for now you have these options:
Still not sure what is the actual cause of the error though...
Comment #3
attiks CreditAttribution: attiks commentedIf you're using jquery_update, which version of jquery: 1.5.2/1.7.1/1.8.2?
Comment #4
attiks CreditAttribution: attiks commentedIf you're using jQuery 1.5.2, this isn't going to work
Quote: "jquery-plugin-validation does not work with jquery 1.5; they did some really weird stuff with extend in their $.ajax shim. After refactoring this one weird line, it seems to work: phihag.de/2011/so/json/jquery.validate.js – phihag Feb 11 '11 at 14:30"
Try using the dev version of jquery_update
Comment #5
attiks CreditAttribution: attiks commentedFYI: the ajax response is valid json, checked using http://jsonlint.com/
Comment #6
Jelle_SAs of jquery_update 7.x-2.3 (there's an alpha1 release of 2.3 but it isn't listed on the project page) you can select the jquery version you want to use. If you select a version other than 1.5 everything should work again.
Comment #8
steveoliver CreditAttribution: steveoliver commentedIn case it might help, see what the fix was for a similar issue we had with Relation Select (#1730262: AJAX errors using Views mini pager):
http://drupalcode.org/project/relation_select.git/blobdiff/d3b96273c8ff8...
In short, the
ajax_iframe_upload
$_POST variable is used for ajax (iframe) uploads, but broke our widget.hook_views_ajax_data_alter
allowed us to temporarily remove the parameter until we were done with our process (and adding the parameter back once we were done).Comment #9
A Romka CreditAttribution: A Romka commentedI was getting this same error, then switched jquery_update to use jquery 1.8 instead of 1.5 and now it's working fine.
Comment #10
Prague man CreditAttribution: Prague man commentedI have jquery 1.8 and the error still show: