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 having a file upload field in a form that uses ajax file validation fails on the ajax request.
This is due to $form_state['clicked_button'] not being existent in an ajax request.
I see two posibilities
- setting clicked_button in ajax requests
- not rely on clicked_button in file validation.
The attached patch implements the second approach and works for me.
Comment | File | Size | Author |
---|---|---|---|
#9 | file-validate-983150-9.patch | 833 bytes | domidc |
#8 | file-validate-983150-8.patch | 855 bytes | domidc |
#4 | file-validate-983150-3760390.patch | 1009 bytes | mattis |
#2 | file_validation.patch | 807 bytes | mattis |
file_validation.patch | 1.19 KB | mattis | |
Comments
Comment #2
mattis CreditAttribution: mattis commentedtry again with a real patch file...
Comment #4
mattis CreditAttribution: mattis commentedit cannot be that hard...
Comment #5
scor CreditAttribution: scor commentedran into the same bug. subscribe.
Comment #6
domidc CreditAttribution: domidc commented#4: file-validate-983150-3760390.patch queued for re-testing.
Comment #8
domidc CreditAttribution: domidc commentedI bumped into this too. I conform the patch is working.
Rerolled against drupal 8
Comment #9
domidc CreditAttribution: domidc commentedBackport to D7
Comment #11
marthinal CreditAttribution: marthinal commentedComment #25
smustgrave CreditAttribution: smustgrave at Mobomo commentedI was not able to reproduce this in D9.5
If still an issue please reopen with an updated issue summary and steps to reproduce please
Thanks!