Issue Bug Closed

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

Christian Hackl 08/30/23, 13:24 updated 11/13/26, 13:20

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 9

  1. Nikita Hovratov commented <span data-processor="relativetime" data-value="2023-09-08T07:29:05+00:00" > 09/08/23, 07:29 </span>

    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.

  2. Christian Hackl commented <span data-processor="relativetime" data-value="2023-09-11T14:41:54+00:00" > 09/11/23, 14:41 </span>

    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

  3. Christian Kuhn commented <span data-processor="relativetime" data-value="2023-09-19T11:06:09+00:00" > 09/19/23, 11:06 </span>

    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.

  4. Oliver Hader commented and changed status New Accepted <span data-processor="relativetime" data-value="2024-02-05T15:14:04+00:00" > 02/05/24, 15:14 </span>

    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

  5. Benni Mack commented and changed status Accepted Closed <span data-processor="relativetime" data-value="2026-11-13T13:20:52+00:00" > 11/13/26, 13:20 </span>

    FYI: Fixed in v12+ with #103316