Actions
Bug #90170
openDatahandler localize translates inline records with non-translatable parent record
Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2020-01-22
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
As an example we have here:
- a custom content element "Slider" (tt_content)
- This "Slider" have 1:n inline records of type "Slider-Item" (tx_theme_domain_model_slideritem)
- Those "Slider-Items" again have 1:n inline records of type "File Reference" (sys_file_reference)
How these look in the TCA:
// Configuration/TCA/Overrides/tt_content.php
'tx_theme_slider' => [
'exclude' => 0,
'label' => $themeBeLanguageFilePrefix.'tt_content.tx_theme_slider',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_theme_slider_item',
'foreign_field' => 'tt_content',
'appearance' => [
'useSortable' => true,
'showSynchronizationLink' => true,
'showAllLocalizationLink' => true,
'showPossibleLocalizationRecords' => true,
'showRemovedLocalizationRecords' => false,
'expandSingle' => true,
'enabledControls' => [
'localize' => true,
],
],
'behaviour' => [
'mode' => 'select',
],
'maxitems' => 20,
],
],
// Configuration/TCA/tx_theme_slider_item.php
'media' => [
'label' => $ll.'tx_theme_slider_item.media',
'config' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'media',
[
'maxitems' => 999,
'minitems' => 0,
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
],
Now the setup:
- Site config with languages "default" and "german"
- An editor with edit permissions only for "german"
- The editor has edit permissions configured for tt_content and sys_file_reference, but NOT for tx_theme_domain_model_slideritem
- Now we create a content element "Slider", add some "Slider Items" as inline relations, those slider items again get some media file references as inline relations.
- Now log in as the editor and translate the slider element to "german".
- Content element is translated
- no slider items translations are created (because the editor has no permissions for them)
- no file references are created. (because those are connected to the tx_theme_domain_model_slideritem record)
- The content element is translated.
- no slider items translations are created (correct)
- File references are created (wrong)
This translation made by the editor now leaves us with orphan translated sys_file_references, that have no tx_theme_domain_model_slideritem, they are connected to. Those will now instead be shown in the default translation of the slideritem. (leaving us with duplicated file references)
It looks like the DataHandler ignores this case: If a record is not translatable, its 1:n children of other tables should NOT be translated as well.
Actions