Issue Bug Closed

#110082Collection records (IRRE with foreign_table_parent_uid) not correctly localized in TYPO3 14

Robert Hafenried 06/21/26, 21:11 updated 11/04/26, 14:55

Description

*Summary*
In TYPO3 13, when a parent record with inline collection records (IRRE) is localized, the foreign_table_parent_uid field of the inline children is automatically set to the UID of the translated parent record. This ensures that translated collection records are correctly linked to the translated parent and appear in the correct language in backend and frontend.

In TYPO3 14, this behavior changed: DataHandler::localize() now copies the foreign_table_parent_uid value from the source record (default language parent) instead of setting it to the translated parent UID. As a result:

Translated collection records point to the default language parent

They appear in the default language backend/frontend instead of the translated language

They are effectively invisible in the intended language

This is a regression from TYPO3 13 and breaks existing extensions that rely on IRRE with a custom foreign_table_parent_uid field.

*
Environment*
TYPO3: 14.x (tested with 14.3)

autotranslate: 3.0.0 (extension that triggers automatic translations)

Works correctly in TYPO3: 13.x (tested with 13.0, 13.3, 13.4)

GitHub issue with required extension changes: https://github.com/thieleundklose/tk-typo3-autotranslate/issues/136

Affected Component
TYPO3\CMS\Core\DataHandling\DataHandler

Method: DataHandler::localize()

Related to: IRRE / Inline relational record editing, localization, language fields

*
Steps to Reproduce*
Create a custom table with an inline (IRRE) field referencing another table.

In the child table, define a custom field foreign_table_parent_uid that stores the UID of the parent record.

Create a new parent record together with at least one collection (child) record in a single save operation.

Configure your site with multiple languages (e.g., German as default, English and French as additional languages).

Use an extension (e.g., autotranslate) or the TYPO3 backend to create translations of the parent record.

Observe the localized collection records:

Their foreign_table_parent_uid still points to the German (default language) parent UID.

They do not point to the English/French translated parent UID.

In the backend and frontend of English/French, the collection records are not visible or are incorrectly linked.

Observed Behavior (TYPO3 14)
When a parent record is localized, TYPO3 creates localized versions of the inline child records.

However, the foreign_table_parent_uid field of the child records is copied from the source record.

The translated children therefore point to the default language parent, not to the translated parent.

As a result, the translated children are not associated with the translated parent and are invisible in the intended language.

*Expected Behavior (as in TYPO3 13)*
When a parent record with inline children is localized, TYPO3 should:

Create localized versions of the child records.

Automatically set foreign_table_parent_uid of the translated children to the UID of the translated parent record.

The translated children should then be correctly linked to the translated parent and appear only in the intended language.

*Technical Root Cause*
In TYPO3 13:

DataHandler::localize() automatically set foreign_table_parent_uid of inline children to the UID of the localized parent record.

This ensured correct parent-child relations across languages.

In TYPO3 14:

DataHandler::localize() copies foreign_table_parent_uid from the source record instead of adjusting it to the translated parent UID.

Additionally, hooks like processDatamap_afterDatabaseOperations fire too early:

At this point, foreign_table_parent_uid of the child is still 0.

TYPO3 sets the correct value only after the hook, via its internal remap stack.

There is no hook that fires after all internal TYPO3 operations are complete, so extensions cannot fix the relation in a hook.

This combination causes translated collection records to have foreign_table_parent_uid = 0 (or default parent UID) and to be invisible in the translated language.

*Why This Is a Regression*
In TYPO3 13, IRRE with a custom foreign_table_parent_uid field worked correctly for localization.

In TYPO3 14, the same setup produces broken relations and invisible content in translated languages.

No alternative hook or API is provided to fix the relation after localization.

Existing extensions (e.g., autotranslate) that relied on the TYPO3 13 behavior must be significantly reworked (queue-based approach, separate request, etc.).

From an extension developer’s perspective, this change introduces only drawbacks and no benefits for this use case.

Current Workaround (requires extension code changes)
The current workaround only works if the autotranslate extension is modified in two places:

DataHandler hook adaptation

The processDatamap_afterDatabaseOperations hook is adapted to:

Not perform immediate translation of collection records.

Collect only the affected record UIDs and parent UIDs.

Write translation jobs to a queue (pending table).

This avoids the timing issue because the translation does not happen in the hook, but in a later step.

Translator adaptation

The translator is adapted to:

Process the queue in a second step (Scheduler job, CLI, or AJAX).

First reload the translated parent UID.

Then translate the collection records.

Finally set foreign_table_parent_uid correctly to the translated parent.

This ensures that the parent relation is only set when the translated parent exists and the DB relation is final.

Without these changes, translated collection records still have foreign_table_parent_uid = 0 or point to the default language parent.

This workaround is inconvenient and requires significant rework of the extension architecture.

*Reference:*
GitHub issue with required extension changes: https://github.com/thieleundklose/tk-typo3-autotranslate/issues/136

*Proposed Fix Options*
Please consider one of the following fixes:

Option A: Restore TYPO3 13 behavior

In DataHandler::localize(), detect inline children with a custom foreign_table_parent_uid field.

Automatically set foreign_table_parent_uid of the translated children to the UID of the translated parent record.

This restores the behavior from TYPO3 13 and avoids breaking existing extensions.

Option B: Provide a stable post-localization hook / event

Introduce a new hook or event that fires after all internal DataHandler operations (including remap stack processing) are complete.

This hook must guarantee that:

All inline children are fully created.

foreign_table_parent_uid is correctly set by the Core.

Extensions can then use this hook to adjust relations if needed.

Option C: Explicit documentation and API for IRRE parent relations

Document the change clearly in the TYPO3 14 changelog.

Provide a documented API or helper method to correctly set foreign_table_parent_uid after localization.

This gives extension developers a stable way to handle this case.

Impact
High impact on existing extensions using IRRE with a custom foreign_table_parent_uid field.

Requires significant rework of extension architecture (queue-based translation, separate request, etc.).

Breaks multilingual workflows where collection records must be linked to the translated parent.

No benefit for end users or developers; only additional complexity and maintenance burden.

The workaround is only possible with explicit code changes in the extension (DataHandler hook + Translator), as described in: https://github.com/thieleundklose/tk-typo3-autotranslate/issues/136

*
Additional Notes*
This issue is not related to autotranslate itself; autotranslate only triggers the localization. The root cause is in the TYPO3 Core’s DataHandler::localize() behavior.

The issue is reproducible with any extension that uses IRRE and a custom parent reference field.

This is a clear regression from TYPO3 13 to 14 and should be treated as a bug, not as an intended change.

The current workaround requires manual code changes in the extension and is not suitable as a long-term solution.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 5

  1. Alexander Schnitzler commented <span data-processor="relativetime" data-value="2026-10-21T08:20:01+00:00" > 10/21/26, 08:20 </span>

    I reproduced this with real installations: TYPO3 13.4.33 (PHP 8.3) and 14.3.3 / 14.3.7 / 14.3.9 (PHP 8.4), Content Blocks 1.6.3 / 2.4.x, a collection field with foreign_field: foreign_table_parent_uid, autotranslate 3.0.0, 3.2.2, 3.3.0, 3.5.0 and 3.6.0, DeepL mocked. Scenario A (parent saved and translated first, child added later) and scenario B (parent and child saved together) were run as DataHandler data maps and through the backend form, and checked at DB level.

    Result: with the same autotranslate version, 13.4 and 14.3 give identical results in every case. I found no regression in the core.

    The outcome depends on where the collection table is registered in the autotranslate settings:

    • child table only in additionalTables: A is wrong on 13.4 as well (foreign_table_parent_uid keeps the default parent); B creates duplicates with wrong parents.
    • child table in additionalTables and additionalReferenceTables: A correct (from 3.2.2), B creates duplicates.
    • child table only in additionalReferenceTables: A and B correct (from 3.2.2), on both cores.

    autotranslate 3.0.0 is wrong in A on both cores; the re-linking came with 3.1.0.

    Mechanism: only the reference-table code path in autotranslate (ensureLocalizedInlineReferenceRecord()) sets the translated parent. If the child is translated as a record of its own, autotranslate calls DataHandler::localize() on the child alone, which copies the foreign field of the default parent. The core behaves the same on 13.4 and 14 for that (and for localize() on the parent, which sets the translated parent correctly). The core does not overwrite anything after processDatamap_afterAllOperations. The duplicates in B come from localizing the parent, which localizes all rows pointing to the default parent, including the child translations autotranslate created just before.

    This matches the analysis in https://github.com/thieleundklose/tk-typo3-autotranslate/issues/169. I suggest to continue there and to close this issue as “not a core bug” (the “Is Regression” flag does not apply).

    Independent of that, the record API shows such wrongly linked children in the default language: #111187.

  2. Robert Hafenried commented <span data-processor="relativetime" data-value="2026-10-21T18:14:28+00:00" > 10/21/26, 18:14 </span>

    Thanks for the thorough reproduction, Alexander. I confirm your findings: with the child table registered only under `additionalReferenceTables` (autotranslate 3.6.0, TYPO3 14.3.7) both scenarios work for me as well, so this is not a core bug.

    Fine to close it as “not a core bug”. The discussion about the extension side continues in https://github.com/thieleundklose/tk-typo3-autotranslate/issues/169.

  3. Georg Ringer commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-04T14:55:36+00:00" > 11/04/26, 14:55 </span>

    closing issue as not a core issue