#101962New records created on a field of type INLINE have the wrong sys_language_uid value
Description
When adding a field of type “inline” to a pi_flexform structure, a new created inline relation record does not have the language value of the parent record. When using the same config on a regular TCA field the new record will have the correct sys_language_uid (synced with the parent).
This is a variation (only names and labels changed) of the flexform:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<records>
<TCEforms>
<label>Records</label>
<config>
<type>inline</type>
<foreign_table>tx_some_record</foreign_table>
<foreign_field>parent_uid</foreign_field>
<foreign_table_field>parent_table</foreign_table_field>
<foreign_match_fields>
<role>some_role</role>
</foreign_match_fields>
<foreign_sortby>sorting</foreign_sortby>
<maxitems>3</maxitems>
<appearance>
<collapseAll>0</collapseAll>
<newRecordLinkTitle>Add new record</newRecordLinkTitle>
<useSortable>1</useSortable>
</appearance>
<behaviour>
<enableCascadingDelete>1</enableCascadingDelete>
</behaviour>
<overrideChildTca>
<columns>
<some_field>
<config>
<default>1</default>
</config>
</some_field>
</columns>
</overrideChildTca>
</config>
</TCEforms>
</records>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
This is the relevant part of the TCA for tx_some_record
<?php
return [
'ctrl' => [
'label' => 'text',
'title' => 'Some record',
'type' => 'type',
'typeicon_classes' => [
'default' => 'tx-some-record',
],
'rootLevel' => 0,
'hideTable' => true,
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
],
'sortby' => 'sorting',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
'languageField' => 'sys_language_uid',
'translationSource' => 'l10n_source',
],
'interface' => [
'maxDBListItems' => 30,
'maxSingleDBListItems' => 50,
],
'columns' => [
'sys_language_uid' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'language',
],
],
'l18n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
'',
0
]
],
'foreign_table' => 'tx_some_record',
'foreign_table_where' => 'AND tx_some_record.pid=###CURRENT_PID### AND tx_some_record.sys_language_uid IN (-1,0)',
'default' => 0
],
],
'l10n_source' => [
'config' => [
'type' => 'passthrough'
],
],
'l18n_diffsource' => [
'config' => [
'type' => 'passthrough',
'default' => ''
],
],
'type' => [
'config' => [
'type' => 'user',
'renderType' => 'hidden',
'default' => '0',
],
],
// other fields
],
'types' => [
// ...
],
'palettes' => [
// ...
],
];Reviews 6
- main 83460[BUGFIX] Respect parent language uid in new FlexForm inline relations
- main 88837[BUGFIX] Skip localization of children for non-language-aware tables
- main 88758[BUGFIX] Copying Inline within FlexForms keep their language
- 13.4 89073[BUGFIX] Copying Inline within FlexForms keep their language
- 13.4 89049[TASK] Add tests for localizing records with flexform
- main 89046[TASK] Add tests for localizing records with flexform
Related issues 11
- Bug #62562Flexforms - Translating with inline relations doesn't work
- Bug #76048IRRE: Child records - New record doesn't get language of parent (non localized records but using new button)
- Bug #90997DataHandler tries to translate relations that are set as non-translatable
- Bug #95918original IRRE fields are shown in translation even if fields were translated already
- Story #101560FlexForm related translation issues
- Bug #103393New IRRE (inline) records created within FlexForm have the wrong sys_language_uid value
- Bug #103969Update language of inline elements is missing, leading to follow up issues
- Bug #103970Inline relations do not set the actual language
- Bug #106431Deleting a record with FlexForm (and IRRE inside Flex) does not delete the IRRE inside Flex
- Task #106551Add tests for FlexForm with localization
- Bug #110497TCEFORM sys_language_uid.disabled = 1 doesn't write correct defaults into translated entries breaking loading of IRRE for child elements