Bug #101801
openTCA - columnsOverrides - type=file - allowed=... reserved strings are not resolved.
0%
Description
The reserved strings "common-image-types", "common-text-types", "common-media-types" aren't resolved (are not replaced by e.g. $GLOBALS['TYPO3_CONF_VARS']['GFX'][...]) at the "columnsOverrides" section, see Example:
$GLOBALS['TCA']['tt_content']['types']['your_custom_type'] = [ 'showitem' => ' // ... media, // ... ', 'columnsOverrides' => [ 'media' => [ 'config' => [ 'allowed' => 'common-media-types', ], ], ],
Updated by Nikita Hovratov about 1 year ago
This does indeed not work, as the TcaPreparation is only applied to the initial TCA processing and not when columnsOverrides is applied in the FormEngine DataProvider.
Updated by Christian Hackl about 1 year ago
Nikita Hovratov wrote in #note-1:
This does indeed not work, as the TcaPreparation is only applied to the initial TCA processing and not when columnsOverrides is applied in the FormEngine DataProvider.
so if i understand you correctly, this is how the behavior is supposed to be?
If that is so, it would be nice to add that in the doc at the possible places to put a hint^^ :)
I also do not know what the sentence / note in the yellow box means? Finally, "enableRichtext" also does more than just change the "view" / "display"... It's a bit confusing.
https://docs.typo3.org/m/typo3/reference-tca/main/en-us/Types/Properties/ColumnsOverrides.html
Updated by Christian Kuhn about 1 year ago
Ah. Nice drawback of that 'common-media-types' magic ...
this is handled in typo3/sysext/core/Classes/Preparations/TcaPreparation.php and simply not applied with columnsOverrides (which is a FormEngine thing). unsure if we should add it to columnsoverrides, probably not. For now, please fall back to the globals or a direct list, instead.
Updated by Christian Kuhn about 1 year ago
- Related to Feature #98479: New TCA type "file" added
Updated by Oliver Hader 10 months ago · Edited
- Status changed from New to Accepted
Confirmed in v12.4.10...
Besides that, when using an array for allowed
(like documented at https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/File/Properties/Allowed.html), the process fails with an exception:
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Array to string conversion in typo3/sysext/backend/Classes/Form/FieldControl/ElementBrowser.php line 85
(Exception above is reproduced in TYPO3 v13.0.0)
The bootstrap_package uses a similar configuration, see https://github.com/benjaminkott/bootstrap_package/blob/master/Configuration/TCA/Overrides/213_content_element_media.php#L70-L76