Issue Bug Resolved

#99516Editors can't delete or disable file references attached to sys_file_metadata

Thomas Rawiel 01/11/23, 10:39 updated 11/12/26, 18:45

Description

Adding a sys_file_reference via TCA Overrides to the sys_file_metadata table.

Editors (Non-Admin) can add the reference but they can’t disable or remove them.

For example:
“Add a poster image to video files”

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_metadata', [
        'poster' => [
            'exclude' => 0,
            'label' => 'Poster Image',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('poster', [
                'appearance' => [
                    'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:media.addFileReference',
                    'collapseAll' => true,
                ],
                'behaviour' => [
                    'allowLanguageSynchronization' => true
                ],
                'overrideChildTca' => [
                    'types' => [
                        '0' => [
                            'showitem' => '
                                    --palette--;;imageoverlayPalette,
                                    --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                            'showitem' => '
                                    --palette--;;imageoverlayPalette,
                                    --palette--;;filePalette'
                        ],
                    ],
                    'columns' => [
                        'link' => false,
                        'description' => false,
                        'alternative' => false,
                        'title' => false,
                    ],
                ],
                'maxitems' => 1,
                'minitems' => 0,

            ],
                'jpg,png,svg'
            )
        ],
    ]);

    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes($table,
        'poster',
        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO,
        'after:duration');

The sys_file_reference is stored on pid=0 which shouln’t be a problem, since sys_file_reference has

'security' => [
    'ignoreWebMountRestriction' => true,
    'ignoreRootLevelRestriction' => true,
],

in the ctrl section.

Another example:
https://github.com/thomasrawiel/video-vtt/blob/main/Configuration/TCA/Overrides/sys_file_metadata.php

Related:
https://forge.typo3.org/issues/75332

A decision was announced to merge sys_file and sys_filemetadata but that was 5 years ago
https://forge.typo3.org/issues/81308#change-356775

Please reevaluate this problem.

Reviews 3

Files 4

History 819

  1. Jens Jacobsen commented and changed attached Bildschirmfoto 2024-08-08 um 14.24.28.png attached Bildschirmfoto 2024-08-08 um 14.23.14.png TYPO3 Version 10 12 PHP Version 7.4 8.3 <span data-processor="relativetime" data-value="2024-08-08T14:22:29+00:00" > 08/08/24, 14:22 </span>

    Update TYPO3 version and PHP Version, bug is still present in 12.4 LTS.

  2. Ernesto Baschny commented <span data-processor="relativetime" data-value="2025-01-08T15:36:12+00:00" > 01/08/25, 15:36 </span>

    Same problem applies to the other “icons” which the admin sees but an editor not: hide/unhide, sort.up, sort.down.

    I needed this fix for an older v11 installation, so I created a patch for it for our own projects – https://github.com/baschny/typo3/pull/2

    If there is interest, I could update the open review from @just2b (https://review.typo3.org/c/Packages/TYPO3.CMS/+/85110) to add the missing icons to the newer v13+ patch too (before it gets merged).

  3. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-12T18:45:11+00:00" > 11/12/26, 18:45 </span>

    Applied in changeset commit:609cdf61ccc5025d22893779e3952bfa45fd8dfe.