Actions
Bug #99516
openEditors can't delete or disable file references attached to sys_file_metadata
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
Actions