Project

General

Profile

Actions

Bug #101801

open

TCA - columnsOverrides - type=file - allowed=... reserved strings are not resolved.

Added by Christian Hackl about 1 year ago. Updated 4 months ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2023-08-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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',
                ],
            ],
        ],

https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/File/Properties/Allowed.html


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #98479: New TCA type "file"ClosedOliver Bartsch2022-09-30

Actions
Actions #1

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.

Actions #2

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

Actions #3

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.

Actions #4

Updated by Christian Kuhn about 1 year ago

Actions #5

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

Actions #6

Updated by Garvin Hicking 4 months ago

  • Category set to FormEngine aka TCEforms
Actions

Also available in: Atom PDF