Problem/Motivation
This error occurs for obscure reasons after the 9.5 Drupal core update and prevents uploading files (thus breaking the form).
This issue does not occur on Drupal 9.4.9.
The only clue provided by the logs is a warning:
Undefined array key "#webform_key" in WebformManagedFileBase::validateManagedFile() on line 869 of WebformManagedFileBase.php
Using xdebug, I've been able to track down the issue to the custom composite's file element, which indeed is missing a "#webform_key" value. Removing the custom composite allows uploading files again.
Steps to reproduce
Install Drupal core 9.5.3 and the webform module; then simply add the attached form and try submitting a file (on any field).
The upload should fail. Clicking on the submit button will display a message warning the user that they might lose data because the upload is still under way.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3343209-3.patch | 768 bytes | renatog |
| webform.webform.test_webform.yml | 11.79 KB | maxime-adagp |
Issue fork webform-3343209
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
renatog commented[Edit] Mistake, please disconsider this one
Comment #4
renatog commentedJust testing here, could you see if this one solve the problem, please?
Comment #7
renatog commentedAnother solution: https://git.drupalcode.org/project/webform/-/merge_requests/307
Comment #8
maxime-adagpTrying the commit you provided in #6 and #7 solved my immediate issue. I've run into other problems but I'll open a separate issue for those. Thanks!
Comment #9
jrockowitz commentedWe need to be able to reproduce this issue before fixing it.
My guess is custom code, or another contributed module is triggering the error.
Comment #10
jrockowitz commented