mask icon indicating copy to clipboard operation
mask copied to clipboard

Allowed file extension overrides of multiple content elements influence each other

Open cweiske opened this issue 7 months ago • 2 comments

Problem

One of my content elements uses a Media field and stores its data in the default tt_content.assets column.

Despite having an empty allowedFileExtensions configuration, it only allows to select files with the following extensions: jpg jpeg png svg webp youtube vimeo.

It should default to common-media-types, though (see #481)

Cause

I have multiple content elements that use the assets field for storage. When adding debug statements to TcaCodeGenerator::getFileTCAConfig() and testing them with ./vendor/bin/typo3 cache:flush, it seems to me as if the allowed file extension settings of one field are used as base for the next field.

Example:

  1. Element "gallery" is the first using the assets column as media field. allowedFileExtensions is initially empty and gets "common-media-types" set by mask because the allowedFileExtensions config is empty.
  2. Element "teaser" is the next with the assets column as media field. allowedFileExtensions is initially set to "gif,jpg,jpeg,bmp,png,pdf,svg,ai,mp3,wav,mp4,ogg,flac,opus,webm,youtube,vimeo", which gets reduced to "jpg,jpeg,png,svg,webp" by mask because the content element definition has this configuration for allowedFileExtensions.
  3. Element "media" is the next with the assets column as media field. allowedFileExtensions is initially set to "jpg,jpeg,png,svg,webp", which is how the previous "teaser" element left it. It misses the video extensions.

The previous content element influences the allowed extensions in the next one.

Version

TYPO3 v12.4.16 with Mask v8.3.10. Also happens with mask v8.3.11, the lastest one.

cweiske avatar Jul 22 '24 10:07 cweiske