Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1414486_multiple_plupload_elements_error_handling_9.patch | 1.07 KB | slashrsm |
#5 | plupload-multiPluploadsInForm-7x1xbeta4.patch | 6.08 KB | annblack |
#4 | multiple_pluploaders_2.patch | 6.55 KB | nbucknor |
multiple_pluploaders.patch | 6.22 KB | nbucknor |
Comments
Comment #1
slashrsm CreditAttribution: slashrsm commentedCan 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.
Comment #2
nbucknor CreditAttribution: nbucknor commentedOnly 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.
Comment #3
slashrsm CreditAttribution: slashrsm commentedOh... sorry. Now I get it...
It looks like it works and fixes the bug. Could you add Drupal.t() around strings?
Comment #4
nbucknor CreditAttribution: nbucknor commentedPatch with Drupal.t()
Comment #5
annblack CreditAttribution: annblack commentedI 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.
Comment #6
slashrsm CreditAttribution: slashrsm commentedCommited to 7.x-1.x: http://drupalcode.org/project/plupload.git/commit/710e33f
Thanks!
Comment #7
slashrsm CreditAttribution: slashrsm commentedPrevious 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".
Comment #8
nbucknor CreditAttribution: nbucknor commentedI 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:
Comment #9
slashrsm CreditAttribution: slashrsm commentedYou mean like this?
Comment #10
nbucknor CreditAttribution: nbucknor commentedyup, 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)});
Comment #11
slashrsm CreditAttribution: slashrsm commentedCommited: http://drupalcode.org/project/plupload.git/commit/83e675a
Thanks!
Comment #13
liquidcms CreditAttribution: liquidcms commentedwas 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).
Comment #14
liquidcms CreditAttribution: liquidcms commentedtried the 1.x-dev as well and also does not work
Comment #15
slashrsm CreditAttribution: slashrsm commentedThis 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?
Comment #16
liquidcms CreditAttribution: liquidcms commentedhmm.. 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:
i guess that is not correct? i need to d/l plupload myself and perhaps i do not have the latest.
Comment #17
liquidcms CreditAttribution: liquidcms commentedi checked and i had version 1.5.1.1 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.
Comment #18
slashrsm CreditAttribution: slashrsm commentedHave you searched their issue queue?
Will correct the text on project page.
Comment #19
liquidcms CreditAttribution: liquidcms commentednot much in their queue. i started using the mupload module which i think also uses plupload and it seems to work.
Comment #20
slashrsm CreditAttribution: slashrsm commentedMupload dpends on this module. :) Could you check your code once again? Maybe you have to change ID's of your elements to prevent collisions.
Comment #21
slashrsm CreditAttribution: slashrsm commentedComment #22
liquidcms CreditAttribution: liquidcms commentedmy code? i have not added any code anywhere.
Comment #23
slashrsm CreditAttribution: slashrsm commentedWhat module were you using in #13?
Comment #24
liquidcms CreditAttribution: liquidcms commentedlol.. i'm confused. i was using this module - that's why i posted against this project.
Comment #25
slashrsm CreditAttribution: slashrsm commentedThis 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.
Comment #26
liquidcms CreditAttribution: liquidcms commentedahh, 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.. :)
Comment #27
liquidcms CreditAttribution: liquidcms commentedand sure enough, upgrading to the latest -dev of Plup fixes the issue.
Comment #28
slashrsm CreditAttribution: slashrsm commentedGreat :)