#111248Translated inline child with a second inline parent loses its language since #103970
Description
Since TYPO3 14.3.10, DataHandler aligns the language of inline children with their parent (#103970, commit c4c5e37ff8f8d7ef215a16228c47006ad844a346). The alignment assumes that an inline child has exactly one parent, which the changelog states as well. With inline relations using foreign_field that is not always the case, and the alignment then turns valid translations into records of the default language and resets their translation pointers. The data loss is silent.
Setup
A child table member, language aware (languageField sys_language_uid, transOrigPointerField l10n_parent, translationSource l10n_source), is shown in two inline lists:
- by a content element, through
tt_content.tx_memberswithforeign_fieldcontent_uid, - by a record of the table
group, which is language aware too, throughgroup.memberswithforeign_fieldgroup_uid.
On the child, group_uid is a select excluded from translation:
'group_uid' => [
'l10n_mode' => 'exclude',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'group',
],
],
p.
Because of @l10n_mode@ exclude, DataHandler writes the group of the default language record into every translation of a member. A translated member therefore always names the default language group. That is the usual pattern for a record listed in two inline relations, for example a contact listed on a page and on its role, or a contract listed on a profile and on an organisational unit.
Steps to reproduce
- Create content element 21 with member 51, and assign group 61 to the member.
- Translate the content element. Its translation 22 gets member 52, a translation of member 51 with
l10n_parent51. Itsgroup_uidis 61, synchronised from member 51. - Open group 61 in the default language and add a new member in its inline list, then save.
The same happens when the group and the translated member are created in one DataHandler run, for example by an import.
Actual result
Member 52 has sys_language_uid 0, l10n_parent 0 and l10n_source 0. It is no translation any more, and the translated content element 22 now lists a record of the default language. In the import case the translation pointers are reset the same way. Whether the child keeps language 1 there depends on which of its two parents is aligned last.
Expected result
Member 52 keeps language 1 and its translation parent. It belongs to content element 22, which is in language 1, and it is in the list of group 61 only because its group is excluded from translation.
Cause
DataHandler::alignLanguageOfInlineChildren() registers group 61 as a parent that got a new child, reads all its children through the RelationHandler of group.members, and aligns every one of them to the language of the group. That includes member 52, whose group_uid points at the default language group by design. As the language of the group is 0, the translation pointers of member 52 are reset as well.
Possible fix
Leave a child alone when it is a translation, its transOrigPointerField being set, and the foreign_field of the relation is a column with l10n_mode exclude on the child table. Such a pointer is synchronised from the default language record, so it can only name the parent of the default language record, and the language of the child is decided by its other parent. That keeps the alignment for every relation in which the parent pointer is the column that owns the child.
Workaround
foreign_match_fields with sys_language_uid 0 on the secondary relation keeps translations out of its children and therefore out of the alignment. It cannot be used on a relation through which the localization of the parent creates the translations of its children, because the match forces language 0 onto the localized children as well.
Found in fgtclb/academic-extensions, where contacts, partnerships and contracts are listed by two or three parents each: https://github.com/fgtclb/academic-extensions/pull/1039. The seed import of that repository is reproduced as a functional test in sbuerk/data-factory: https://github.com/sbuerk/data-factory/pull/58
Reviews 2
Related issues 1
History 24
-
Stefan Bürk changed Related to #103970 <span data-processor="relativetime" data-value="2026-10-26T12:58:56+00:00" > 10/26/26, 12:58 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 97202 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-28T16:13:25+00:00" > 10/28/26, 16:13 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 97409 <span data-processor="relativetime" data-value="2026-11-06T21:59:14+00:00" > 11/06/26, 21:59 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-06T22:05:11+00:00" > 11/06/26, 22:05 </span>
Applied in changeset commit:b978d9d1d833bcd4b687cd6f52181cd83d5427cc.