Project

General

Profile

Actions

Bug #103815

open

Custom added categories column in file references palette triggers duplicates by moving records

Added by Julian Mair 6 months ago. Updated 3 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2024-05-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Files

Actions

Also available in: Atom PDF