Issue Bug Accepted Quiet

#84618Not possible to translate a record when allowLanguageSynchronization is set for relation field like 'image' in tt_content

Helmut Hummel 04/04/18, 17:13 updated 10/30/26, 16:56

Description

Szenario:

tt_content record of type image in default language with one image (default language en)
translated tt_content record in one language with individual image(s) selected in this record (language dk)

Action:
translate the record in a third language with selecting the translated (dk) record as source.

Expectation:
A translated record is created with sync set to translation source

Actual:
exception is thrown and image(s) in dk record is multiplied

Reviews 0

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

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Not possible to translate a record when allowLanguageSynchronization is set for relation field like 'image' in tt_content Resolves: #84618 Releases: main

History 8

  1. Helmut Hummel commented <span data-processor="relativetime" data-value="2018-04-04T17:20:08+00:00" > 04/04/18, 17:20 </span>

    Same scenario works well with text fields, but not with relational fields

  2. Nicole Hummel commented and changed status New Accepted <span data-processor="relativetime" data-value="2018-09-09T19:43:01+00:00" > 09/09/18, 19:43 </span>

    Behavior in current master: the overlay is never hidden anymore. An exception is thrown but not display anywhere. I had even three images assigned to the existing database record (dk)

  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2024-04-27T19:59:38+00:00" > 04/27/24, 19:59 </span>

    I’ve not understood how to reproduce this one on the latest main (13.2.0-dev) but maybe I am doing something wrong

    My scenario:

    • TYPO3 13.2.0-dev
    • Three languages: Italian (uid=0), English (uid=1), French (uid=2)
    • A page translated in all three languages

    Test procedure

    1. On the page, create a “Text and Image” Content element in the default language (uid=0) ; add an image, Save and close
    2. Translate the content element in English (uid=1) (connected mode) and add another image only in english, save and close
    3. Translate the content element in French (uid=2) (connected mode), selecting english (uid=1) ad the source language , save and close

    Results

    • The record in the default (uid=0) language has ONE image
    • The record in the (uid=1) language has TWO images
    • The record in the (uid=2) language has THE SAME TWO images
    • No duplicated images
    • No error as far as I can tell

    Is a different test necessary?

    NOTE:

    In the page module > Language comparison > All languages on, the column on the “French” language I still see the “Translate button” but it is broken:
    If I click on it, it opens the translation wizard modal window but… it is empty! (There are no records left to translate); moreover the “next” button is still clickable, and it leads to an infinite-spinning empty “processing” modal. This is a known bug https://forge.typo3.org/issues/97763

  4. Benni Mack commented <span data-processor="relativetime" data-value="2026-10-30T16:56:04+00:00" > 10/30/26, 16:56 </span>

    I dug into this: Still valid on main / v15.

    The scenario in the comment above did not enable allowLanguageSynchronization on the field, which is what triggers the problem. Reproduced on main with a functional test:

    1. Enable 'behaviour' => ['allowLanguageSynchronization' => true] for tt_content.image
    2. Translate a content element with two images to language 1 (connected mode)
    3. In the translation, switch the image field to “custom” and add a third image, which exists in language 1 only
    4. Translate the language 1 record to language 2, using language 1 as source

    Result: RuntimeException: Child record was not processed (1486233164) in DataMapProcessor::synchronizeReferences(), and an unclean reference index.

    Cause

    The problem is not “translating a child from a non-default language” in general. Children of the language 1 record that are translations of default language children work fine: their language 2 copies point to the same default language record via l10n_parent, and DataMapProcessor follows that chain.

    It fails only for children that originate in a translation, here the image added in language 1 only. That child has l10n_parent = 0, and so does its language 2 copy. Nothing points from the copy back to its source child:

    • sys_file_reference has neither translationSource (l10n_source) nor origUid (t3_origuid)
    • DataMapProcessor::fetchDependentElements() only considers connected-mode records (l10n_parent > 0), so even a translation source pointer would be ignored for such rows

    DataHandler::localizeRecord() already creates the language 2 copy of the child. DataMapProcessor cannot find it, considers the child missing, tries to localize it a second time, the nested-call guard of DataHandler::localize() returns false, and the exception is thrown.

    Parent records do not have this problem: a parent without l10n_parent is in free mode and not synchronized at all. The gap only exists one level down, for children owned by a connected translation in custom mode.

    Options

    *A) Pair the copies without a pointer (no schema change)*
    When a new translation is created, the copies of all children already exist in the same order as the source children. Children without l10n_parent could be paired with their copies by position, similar to the existing “re-use sanitized value” shortcut in synchronizeReferences().
    • (+) No new column, can be backported
    • (-) Only works while the translation is created. On every later save of the source translation, the copies cannot be matched: they would be deleted and localized again with new uids. #88452 treated the same behaviour as a bug for monoglot children.
    *B) Enforce origUid for synchronized child tables*
    @DataHandler::localizeRecord()@ already sets the origin pointer if the table has one. The TcaPreparation step from #88452, which enforces origUid for monoglot child tables, would also cover language-aware child tables. DataMapProcessor then matches children without l10n_parent through t3_origuid, restricted to the children already attached to the parent translation.
    • (+) Stable uids, reuses the mechanism of #88452
    • (+) Does not change the translation semantics of the child table: code reading translationSource (FormEngine, LocalizationRepository, workspaces, impexp) is not affected
    • (-) New column t3_origuid on sys_file_reference in every installation, since pages.media synchronizes its references by default. Main only.
    *C) Enforce translationSource (l10n_source) for synchronized child tables*
    Same as B, using l10n_source as pointer.
    • (+) Stable uids
    • (-) New column l10n_source on sys_file_reference in every install
    • (-) Adds translation semantics to child tables, which affects every consumer of translationSource
    D) Only report affected configurations in EXT:reports
    • (-) Does not help on its own: DataMapProcessor ignores pointers on , so reconfiguring the child table changes nothing without a core change
    • (-) Would flag every installation, because of pages.media
    • (-) The problem depends on data (a translation in custom mode with owation source), not only on configuration
    • (-) EXT:reports is optional