Project

General

Profile

Actions

Bug #99516

open

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

Added by Thomas Rawiel over 1 year ago. Updated 12 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2023-01-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Files

vtt-file.PNG (20.3 KB) vtt-file.PNG Thomas Rawiel, 2023-01-11 10:36
poster-image.PNG (68.6 KB) poster-image.PNG Thomas Rawiel, 2023-01-11 10:38

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #75332: Saving relations to files in sys_file_metadata does not work for normal usersClosed2016-03-31

Actions
Related to TYPO3 Core - Bug #81308: Deleting a referenced file via filelist module, definined in sys_file_metadataClosed2017-05-22

Actions
Actions #1

Updated by Georg Ringer 12 days ago

  • Related to Bug #75332: Saving relations to files in sys_file_metadata does not work for normal users added
Actions #2

Updated by Georg Ringer 12 days ago

  • Related to Bug #81308: Deleting a referenced file via filelist module, definined in sys_file_metadata added
Actions #3

Updated by Gerrit Code Review 12 days ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85110

Actions

Also available in: Atom PDF