I'm using the Mupload module to add multiple plupload elements to a node form, however the current plupload.js files submit handler does not work very well if you have more than one plupload element in your form. Attached is a patch to fix this issue.


Status:Needs review» Postponed (maintainer needs more info)

Can you describe which errors you encounter while having multiple Plupload elements on a form? I tested it on a node form with 2 image fields with Mupload widgets and I was unable to reproduce any issues caused by the fact that there are multiple widgets on a form.

Only the first Mupload widget would submit correctly if you try to submit the form without clicking upload on each of the widgets. My patch tests to see if all widgets have completed their uploads before submitting the form. Previously the form would submit once the first widget has completed its upload.

Status:Postponed (maintainer needs more info)» Needs work

Oh... sorry. Now I get it...

It looks like it works and fixes the bug. Could you add Drupal.t() around strings?

Status:Needs work» Needs review
new6.55 KB

Patch with Drupal.t()

I hit the exact same issue and had created a local fix. However, I like nbucknor's fix better. Thanks! I re-spun the patch so that it can be applied on top of beta4. It would be great if the fix can be integrated in.

Status:Needs review» Fixed

Status:Fixed» Needs work

Previous commit caused an unnecessary popup saying "Please wait while your files are being uploaded." on every submit. This should be removed by this commit: http://drupalcode.org/project/plupload.git/commit/3407285

I also think that errors currently do not work OK, if we have multiple errors on multiple plupload elements at the same time. It looks like the last error will overwrite all the previous ones. Since this should be fixed I mark this as "needs work".

I agree that error reporting with multiple plupload elements needs a lot of work. In my patch, I had a list of errors indexed by each element and separated by linebreaks. Somehow that got mangled in your commit to dev.
See below:

else if (uploader.files.length == 0) {
    errors += Drupal.t("@index: You must upload at least one file.\n",{'@index': (index+1)});

Status:Needs work» Needs review
new1.07 KB

You mean like this?

yup, but notice it should be index+1 instead of index1 for the text replacement bit.

errors += Drupal.t("@index: You must upload at least one file.\n",{'@index': (index+1)});

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

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

Status:Closed (fixed)» Active

was this actually fixed? i have 1.1 and i cannot get 2nd plupload field to work - if i drag/drop an img to that field it simply displays the img full screen and if i drag an img into the first plupload field it adds it to both fields (as ready for upload).

tried the 1.x-dev as well and also does not work

Status:Active» Postponed (maintainer needs more info)

This is included in 7.x-1.1. This patch was mostly about error handling and making form aware of more Plupload elements.

The issue you report might be Plupload's issue. Have you checked their issue queue?

hmm.. ok, to be honest i took over dev on this project and didn't realize that plupload was an ext library - although on your project page you state:

Drupal 7 version provides Plupload library and form element.

i guess that is not correct? i need to d/l plupload myself and perhaps i do not have the latest.

i checked and i had version of plupload lib; not sure which version i am supposed to have but i grabbed latest (1.5.6) and it does not help the issue.

Have you searched their issue queue?

Will correct the text on project page.

not much in their queue. i started using the mupload module which i think also uses plupload and it seems to work.

Status:Postponed (maintainer needs more info)» Closed (works as designed)

Mupload dpends on this module. :) Could you check your code once again? Maybe you have to change ID's of your elements to prevent collisions.

Status:Closed (works as designed)» Fixed

my code? i have not added any code anywhere.

What module were you using in #13?

lol.. i'm confused. i was using this module - that's why i posted against this project.

This is API module. You have no use from it unless you write your own code or use another module that depends on it. See project page for list of those.

ahh, sorry, i see now (as i mentioned, were are not the original designers of this site) - the plup module is the one creating the widget - so likely that module which has the issue.

thanks for sticking with this.. :)

and sure enough, upgrading to the latest -dev of Plup fixes the issue.

Great :)

Status:Fixed» Closed (fixed)

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

  • Commit 710e33f on 7.x-1.x, 7.x-2.x, 8.x-1.x by slashrsm: Issue #1414486 by nbucknor, annblack: Allow for Multiple Plupload...
  • Commit 83e675a on 7.x-1.x, 7.x-2.x, 8.x-1.x by slashrsm: Issue #1414486 by nbucknor,slashrsm: Improvements of errorhandling for...