Undefined array key "#webform_key" in WebformManagedFileBase::validateManagedFile()

Created on 20 February 2023, almost 2 years ago
Updated 11 April 2023, over 1 year ago

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.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

6.1

Component

Code

Created by

πŸ‡«πŸ‡·France maxime-adagp Paris, France πŸ‡«πŸ‡·

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024