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.
I created one simple form with a file component. On user interface , the user browses a file and click on "Upload" button. The file has been uploaded successfully.
But on other hand, the user browses a file and click directly on the form "Submit" button, then file upload is not working. Let me know whhat is the solution for this issue?
Thanks in advance..
Comments
Comment #1
David Stosik CreditAttribution: David Stosik commentedHi,
Thanks for the bug report. Sadly, this is a bug I already spotted, which is due to a bug or limitation in Drupal core.
Please see this issue for more details: #1513200: managed_file form component not submitted on AJAX submit.
Regards,
David
Comment #2
monymirzaLooks like i have found the solution. let me create a patch.
Comment #3
seanBA workaround could be creating a JS file in a custom module to overwrite the function that messes this up.
Add a form alter to add a class to your submit button and add the js file:
And add your modules js file to overwrite the core js function.
Comment #4
rafaelferreir4 CreditAttribution: rafaelferreir4 as a volunteer and at Peytz & Co commentedSolution #3 worked for me! Thanks!
Comment #5
anou#3 still work today! Thx seanB ;-)