Breaking: Removed FileUploadConverter
Description
The custom Extbase type converter
\FGTCLB\
and its extbase. service registration are removed, together with
the language files holding its error messages:
EXT:academic_ base/ Resources/ Private/ Language/ locallang. xlf EXT:academic_ base/ Resources/ Private/ Language/ de. locallang. xlf
Both files only contained the labels upload.,
upload., upload., upload. and
validation., which the converter emitted.
locallang_ is unaffected.
The converter was replaced by the native Extbase file upload handling introduced
in TYPO3 v13.3 (File, see TYPO3 feature forge#103511),
which covers the same use case with core validators and core error messages. The
last two consumers were migrated first: EXT: and
EXT:.
The class was flagged
@internal
and explicitly excluded from the breaking
policy and semver. The removal is documented as breaking nevertheless, following
the precedent of the Image removal in EXT: 2.1,
because projects may have used it regardless.
Impact
Registering the converter for an own argument, referencing the class, its
CONFIGURATION_* constants or the removed labels raises a PHP error or resolves
to an empty string.
Uploads handled by the shipped plugins are unaffected in configuration, but
change in behaviour — stored file names, mime type detection and the point in
time the file is stored all differ. Those changes are described in the
Important entries of EXT: and EXT:.
Affected Installations
Installations that use the converter in own code, or that override one of the removed labels.
Migration
Use the native Extbase file upload handling. Build a
\TYPO3\ and add it to the
argument, either through the
# attribute or programmatically
in an initialize<Action>Action method when the configuration comes from
TypoScript:
public function initializeAddImageAction(): void
{
$argument = $this->arguments->getArgument('profile');
$configuration = (new FileUploadConfiguration('image'))
->setMaxFiles(1)
->setUploadFolder('1:/user_upload/');
$fileSizeValidator = GeneralUtility::makeInstance(FileSizeValidator::class);
$fileSizeValidator->setOptions(['maximum' => '2M']);
$configuration->addValidator($fileSizeValidator);
$argument->getFileHandlingServiceConfiguration()
->addFileUploadConfiguration($configuration);
$argument->getPropertyMappingConfiguration()->skipProperties('image');
}
The converter options map onto the core API as follows:
| Converter option | Replacement |
|---|---|
upload |
File |
validation |
File option maximum |
validation |
Mime option allowed |
target | no replacement, the core API generates the stored file name |
Mime throws for an empty allowed option, so
register it only when an allow-list is configured to keep an empty setting
meaning "no restriction".