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.
When I attach my files to the form element and press start upload everything works fine.
If I attach my files and just submit the form, the upload status very quickly goes to 100% (almost immediately) and my form page refreshes. None of my submit functions run.
Comments
Comment #1
slashrsm CreditAttribution: slashrsm commentedAre you using this on your custom for or with any other contrib module?
Have you tried to use #submit_element? See: #1935256: When a form has more than one submit button plupload always submits using the first one.
Comment #2
matt.h CreditAttribution: matt.h commentedThanks for the reply.
This is in a custom module.
As you can see, for the time being I have had to educate my users to start upload prior to form submit.
I do have other submit buttons on the form for ajax controls, but I haven't had any issues with it submitting on those. I did try your suggestion with #submit_element => 'edit-submit', but no change.
I also tried one of the patches for Auto Submitting that I found on here, but that just jacked up my form element.
Comment #3
matt.h CreditAttribution: matt.h commentedThis was solved by using '#submit_element' on my plupload form field.
I apparently can't read or something, and used the wrong submit button ID...who knows. Works fine now.
Comment #4
matt.h CreditAttribution: matt.h commentedA tiny bit more detail...when I first tried #submit_element I used 'edit-submit' for the button Id. That obviously didn't work. It needed to be '#submit_element' => '#edit-submit' - with the ID #, in case someone else out there is an airhead like me.
Comment #5
slashrsm CreditAttribution: slashrsm commentedGreat. Nice to hear that it worked.
Would you be prepared to document this? https://drupal.org/node/1647890