Installing the jQuery Update module on a Drupal 7 website breaks the upload of images in the content creation process. Uploading an image usually results in the display of a thumbnail of the image (with options for adding alt and title information). With jQuery Update, the upload throbber continues to spin endlessly. Removing jQuery Update solves the problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lennard’s picture

Yes i can say the same. Thats modul is not really worked.

Its not only Upload does not work the delete of exists files are blocked too.

Its really must be fix. The Version before has worked fine this is a back step.

Anonymous’s picture

I've just spent several days trying to track down why image uploads & deletes were no longer working on my site. Turns out it was this module (I was 7.x-2.x-dev, but just now tested 7.x-2.0 & got the same result.) Disabling the module restores image upload & delete capability.

DerekAhmedzai’s picture

Yes, same here. I spent hours trying to troubleshoot broken uploads - disabled jquery update and they were fine again.

santam’s picture

I can second the issue. Seems that enabling the module breaks all upload actions. For example I had a form where people had the option to add more text fields one after another. Even the add another item button did not work as the throbber never stopped. There was the same issue with the image field too. Disabling jquery module allowed all these to get back to normal. Another interesting thing was it also affected the auto tag term reference field functionality making it slower and less responsive

emackn’s picture

yep.. same here.
The file will upload, but the throbber will never disappear.
Reloading the page displays the file.

File removal is broken, there is a "b.handleError is not a function" error from firebug.

b.handleError is not a function
http://example.com/misc/jquery.form.js?v=2.52
Line 13

stack trace:

ajaxSubmit()jquery.form.js?v=2.52 (line 13)
ajaxSubmit()jquery.form.js?v=2.52 (line 13)
onload(event=load )edit?d...t/seq/3 (line 2)
sahaj’s picture

subscribe. was wondering what was the reason of this.

bigsyke’s picture

Same here

nunof’s picture

Subscribing

cloviscoli’s picture

Subscribing

fatcrobat’s picture

Assigned: Unassigned » fatcrobat
Status: Active » Needs review
FileSize
37.42 KB

jquery 1.5 includes a large rewrite of the ajax module. So in addition they implemented a new Deferred callback management system. Seems like, the old $.handleError function is no longer part of jQuery 1.5.

The following patch includes an update of the jquery form plugin.
Fileupload is working as expected. Don't forget to clear your cache.

Please test and give feedback.

sahaj’s picture

After having applied the patch #10, getting this error message while trying to remove image :

An error occurred while attempting to process /.../file/ajax/field_image/und/0/form-IzKh9zuy6FvHtHK5SVK2uK4tsKbi7fFx6qj0-HpUg1o: Result of expression 'ajax.form.ajaxSubmit' [undefined] is not a function.

fatcrobat’s picture

The patch creates two new files in the jquery_update/replace/jquery folder.
Please check, for jquery.form.js and jquery.form.min.js.

Cleared your cache? Adding and removing images works for me as supposed.

Anonymous’s picture

I applied the patch, & got the same error as #11. It looks like the patch creates the 2 files listed in # 12, but places them in the module's root directory. Moving them to the correct folder fixes the error & patch works as desired.

fatcrobat’s picture

Mhh, tested it locally in my eclipse ide running the project as git repository...strange. Did you guys applied the patch from the jquery_update folder, or drupal root?

TimG1’s picture

Subscribing.

In my case the file is actually uploaded to the directory, however the thumbnail doesn't appear and the throbber just keeps running.

If you just close out of the node edit form without saving then the image field is not saved, but the file is still sitting in the /files directory on the server. However, if you go ahead and save the node instead of closing the form, then the image is saved in the image field and the preview can be seen.

Just applied the patch in #10 and it seems to be working as expected now. =)

-Tim

davidsanger’s picture

I am brand new to Drupal and beginning work on my first, simple Drupal 7 site and came upon this bug.

Is there a simple way to apply this patch (eg. instructions) or will an updated version of Drupal Core or some module take care of it very soon?

Right now I have an image on my front page I cannot remove.

thanks

fatcrobat’s picture

FileSize
637.24 KB

here you are ;)

RobLoach’s picture

Title: jquery update breaks the file upload action » Update jQuery Form to 2.64
Version: 7.x-2.0 » 7.x-2.x-dev
Assigned: fatcrobat » Unassigned
Status: Needs review » Reviewed & tested by the community

Yup yup yup! Thanks a lot :-) .

davidsanger’s picture

thanks, get it now.

that seems to have done the trick.

mfer’s picture

Status: Reviewed & tested by the community » Fixed

jQuery form 2.67 is now out. It is included in the latest code in the 7.x-2.x branch as a replacement. Please test and let me know if there are any issues.

jvendryes’s picture

How do we get the latest update with 2.67 included? I just downloaded the latest 7-1.x-2.1.tar.gz and it appears that 2.52 is still included?

Nevermind, for some reason the latest jquery-form isnt being pulled into my site...

fatcrobat’s picture

https://github.com/malsup/form

download and replace

mfer’s picture

2.67 is already in jQuery Update 7.x-2.1. If it is not loading it's not because the file isn't there... http://drupalcode.org/project/jquery_update.git/blob/8a3a09fe9cfd23163ef...

Status: Fixed » Closed (fixed)

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

iLLin’s picture

To open this back up I'm not sure why everyone elses is working and mine doesn't load.

In system.api.php in Line 699:

function hook_js_alter(&$javascript) {
  // Swap out jQuery to use an updated version of the library.
  $javascript['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js';
}

This overwrites the jquery_update_library_alter back to the base misc/jquery.js file.

I added:

function jquery_update_js_alter(&$javascript) {
  $path = drupal_get_path('module', 'jquery_update');
  $min = variable_get('jquery_update_compression_type', 'min') == 'none' ? '' : '.min';
  $javascript['misc/jquery.form.js']['data'] = $path . '/replace/misc/jquery.form' . $min . '.js';
}

This fixed it. I didn't provide a patch yet as I am unclear why people say they have this working?

iLLin’s picture

Status: Closed (fixed) » Active
mfer’s picture

Status: Active » Closed (fixed)

@iLLin For this module to work you just download and enable it. Nothing more is needed.

What is in system.api.php is never called. This is documentation for hook_js_alter. jQuery Update does not use this hook anyway.

iLLin’s picture

Status: Closed (fixed) » Active

Well its called on my setup and thats why this hook did not work. I know jQuery Update does not use this hook and if you read, that is what I used to fix it. I am re-opening this back-up and I will track why my install is different than yours as the system.api.php is overwriting the misc/form.js data array.

mfer’s picture

Status: Active » Closed (fixed)

@iLLin system.api.php is a documentation file. It should never be loaded and used in a site. It is present for documentation purposes as are all files ending in .api.php. This issue is not related to jquery_update.

If system.api.php is loaded on your site there is a problem with your installation. None of the .api.php files should be loaded in a drupal page load. Something is breaking your install. If you want to track this open up a new support request ticket. Fixed bug reports not relating to your issue should remain closed.

iLLin’s picture

@mfer I gotcha. I will try to track it down, it seemed related to this issue but your right the system.api isn't called (thx for clarifying the use of that file).

ucaka’s picture

If someone is experiencing the issue of not loading the correct version of jquery.form.js like iLLin. Check if some of the installed modules aren't using drupal_add_js() to add the jquery.form.js file on every page.

sstedman’s picture

I saw this same issue after upgrading a D6 site to D7. Popups API remains intact as a D7 module, even though there is not a D7 version of the module. It was left enabled until an Image Field was set up for multiple image uploads and fired this error. The upgraded Popups API was indeed calling jquery.form 2.52 and overwriting jQuery Update's jquery.form 2.64.

For any one out there who sees this edge case after upgrading D6, disable and delete Popups API, Popups: Administration Links and Popups: Test Page.

mr.andrey’s picture

For reference:

To make #10 work with jQuery 1.7 and latest jquery_update in D6, do the following:

Apply patch in #10. First part will fail, don't worry.
In jquery_update.module, find this:
'misc/jquery.form.js' => 'jquery.form.js',
… and replace with this:
'misc/jquery.form.js' => 'jquery/jquery.form.js',

Now "Add another item" works fine.

Cheers,
Andrey.

P.S. One of many fixes to make jQuery 1.7 work in D6 with views/panels/etc... don't bother unless you have a really good reason.

spesso’s picture

Component: User interface » Code

Ref: #31.

In my case that was the Multiupload Imagefield Widget / Multiupload filefield Widget modules: adding the js_alter suggested in #25, after the patches, solved the problem.