Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowed file extension overrides of multiple content elements influence each other #635

Open
cweiske opened this issue Jul 22, 2024 · 2 comments
Labels

Comments

@cweiske
Copy link
Contributor

cweiske commented Jul 22, 2024

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.

@nhovratov
Copy link
Collaborator

nhovratov commented Jul 22, 2024

Do you have the feature overrideSharedFields enabled?

@cweiske
Copy link
Contributor Author

cweiske commented Jul 22, 2024

Yes, overrideSharedFields is enabled.

A workaround for this bug is to configure each media element to have allowedFileExtensions: common-media-types.

@nhovratov nhovratov added the bug label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants