Cannot upload files -- update file extension check

Created on 9 May 2025, 15 days ago

Problem/Motivation

The Drupal\webform_dropzonejs\Element\WebformDropzonejs::preRenderDropzoneJs uses $element['#extensions'] = $element['#upload_validators']['file_validate_extensions'][0] ?? ''; to determine valid file extensions. This doesn't seem to be valid anymore in newer versions of webform/Drupal.

https://www.drupal.org/project/webform/issues/3465838 ✨ Drupal 11 compatibility fixes for webform Active handles this as follows:

-    $validators = ['file_validate_extensions' => ['csv']];
+    $validators = ['FileExtension' => ['extensions' => 'csv']];

We need to do the same.

Steps to reproduce

Update to a recent version of core/webform and try to drag and drop to upload a file. Upload fails no matter what the file type is. Futher, clicking "select files" doesn't even allow selection of any files because it thinks there are no valid extensions.

Proposed resolution

Update extension validation.

Remaining tasks

update extensions validation

User interface changes

none

API changes

none

Data model changes

none

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mrweiner

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024