Project

General

Profile

Actions

Bug #99516

open

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

Added by Thomas Rawiel about 2 years ago. Updated about 1 month 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:
12
PHP Version:
8.3
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
Bildschirmfoto 2024-08-08 um 14.24.28.png (238 KB) Bildschirmfoto 2024-08-08 um 14.24.28.png Admin users can delete file references in metadata Jens Jacobsen, 2024-08-08 14:22
Bildschirmfoto 2024-08-08 um 14.23.14.png (213 KB) Bildschirmfoto 2024-08-08 um 14.23.14.png Editor users can't delete file references in metadata Jens Jacobsen, 2024-08-08 14:22

Related issues 3 (0 open3 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
Related to TYPO3 Core - Bug #77487: File references to file metadata cannot be deletedClosed2016-08-11

Actions
Actions #1

Updated by Georg Ringer 9 months 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 9 months 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 9 months 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 #4

Updated by Jens Jacobsen 7 months ago

  • Related to Bug #77487: File references to file metadata cannot be deleted added

Updated by Jens Jacobsen 7 months ago

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

Actions #6

Updated by Gerrit Code Review 5 months ago

Patch set 2 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 #7

Updated by Ernesto Baschny 2 months ago

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 @Georg Ringer (https://review.typo3.org/c/Packages/TYPO3.CMS/+/85110) to add the missing icons to the newer v13+ patch too (before it gets merged).

Actions #8

Updated by Gerrit Code Review about 1 month ago

Patch set 3 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