Issue Bug Resolved

#111248Translated inline child with a second inline parent loses its language since #103970

Stefan Bürk 10/26/26, 12:58 updated 11/06/26, 22:05

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_members with foreign_field content_uid,
  • by a record of the table group, which is language aware too, through group.members with foreign_field group_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

  1. Create content element 21 with member 51, and assign group 61 to the member.
  2. Translate the content element. Its translation 22 gets member 52, a translation of member 51 with l10n_parent 51. Its group_uid is 61, synchronised from member 51.
  3. 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

History 24

  1. Benni Mack commented and changed status Under Review Resolved done 0 % 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.