Error when uploading files in D10.2+ due to file validations

Created on 12 December 2024, about 1 month ago

Problem/Motivation

When editing files with this module in D10.2+, the following error message would result:

TypeError: Drupal\file\Upload\FileUploadHandler::handleExtensionValidation(): Return value must be of type string, null returned in Drupal\file\Upload\FileUploadHandler->handleExtensionValidation() (line 431 of core/modules/file/src/Upload/FileUploadHandler.php).}}

This is related to the matters discussed here: https://www.drupal.org/project/drupal/issues/3420802 πŸ› file_save_upload broken by 10.2.x Needs work as the variable names have been updated in newer versions of Drupal. This patch may also resolve some of the TODOs in FileManagementEditFileForm.php

Steps to reproduce

Default installation in D10.2+ (Hasn't been tested in D11)

Proposed resolution

A minor patch to update to update the logic of FileManagementEditFileForm.php to make it more compatible with D10.2+. This has not been tested in D11. Please note that this patch by default has a certain subset of file types coded in for validation purposes.

πŸ› Bug report
Status

Downport

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nycnuac

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

Comments & Activities

Production build 0.71.5 2024