#103815Custom added categories column in file references palette triggers duplicates by moving records
Description
I added a category column to the file references’ image palette. When i move the records up or down, the category tree of the moved element will be duplicated by each move. (see screenshots below)
System:
- TYPO3 12.4.14
- PHP 8.3.2
- MariaDB: 10.11
Steps to reproduce:
- Add a `categories` column to the sys_file_reference TCA (Configuration/TCA/Overrides/sys_file_reference.php)
e.g.:
$tca = [
'categories' => [
'exclude' => true,
'config' => [
'type' => 'category',
'size' => 10,
],
],
];
ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $tca);
ExtensionManagementUtility::addToAllTCAtypes('sys_file_reference', 'categories');
- Add this field to the `imageoverlayPalette` palette
e.g.
$palette = [
'imageoverlayPalette' => [
'showitem' => 'alternative,description,--linebreak--, link,title,--linebreak--,crop,categories',
],
];
$GLOBALS['TCA']['sys_file_reference'] = array_replace_recursive(
$GLOBALS['TCA']['sys_file_reference'],
$palette
);
- Navigate to a media field within a page record, upload at least two images, and rearrange them by dragging up or down. Note that each move will duplicate the categories tree, but you can restore the user interface to its normal state by reloading or saving the page.