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.

Issue fork webform-3343209

Command icon 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

maxime-adagp created an issue. See original summary.

RenatoG made their first commit to this issue’s fork.

renatog’s picture

Status: Active » Needs review
StatusFileSize
new769 bytes

[Edit] Mistake, please disconsider this one

renatog’s picture

StatusFileSize
new768 bytes

Just testing here, could you see if this one solve the problem, please?

The last submitted patch, 3: 3343209-2.patch, failed testing. View results

renatog’s picture

maxime-adagp’s picture

Version: 6.1.4 » 6.1.x-dev
Status: Needs review » Reviewed & tested by the community

Trying 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!

jrockowitz’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

We need to be able to reproduce this issue before fixing it.

My guess is custom code, or another contributed module is triggering the error.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)