Bug #91842

Entries in sys_category_record_mm are created also for translated categories

Added by Michal Majernik 14 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2020-07-22
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
7.2
Tags:
sys_category, sys_category_record_mm, l10n_mode, exclude
Complexity:
Is Regression:
Sprint Focus:

Description

If I define a categorizable Field via Overrides with sys_language_uid 0 and -1 as follows:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
    'example',
    'tx_example_domain_model_item',
    'categories',
    [
        'label' => 'Categories',
        'exclude' => false,
        'fieldConfiguration' => [
            'foreign_table_where' => ' AND {#sys_category}.{#sys_language_uid} IN (-1, 0) ORDER BY sys_category.title ASC',
            'minitems' => 1,
            'maxitems' => 1,
        ],
        'l10n_mode' => 'exclude',
        'l10n_display' => 'hideDiff',
    ]
);
Then:
  1. I create a category without translations
  2. I create an Item and its translations with the selected category

=> a single sys_category_record_mm Relation is created

Then:
  1. I create a translation for the category

=> a second sys_category_record_mm Relation is created

Then:
  1. I save the Item

=> the second sys_category_record_mm Relation is removed

Expected behavior:
The second Relation should never be created as the categories field cannot be translated ('l10n_mode' => 'exclude')

Also available in: Atom PDF