- Issue created by @nycnuac
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
Default installation in D10.2+ (Hasn't been tested in D11)
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.
Downport
2.1
Code