Issue Bug Under Review Quiet

#92937Translation wizard of tt_content having l10n_source = 0 shows too many items

Markus Gerdes 11/26/20, 08:25 updated 10/16/26, 08:45

Description

Using the translation wizard in the backend shows too many content elements in selection view
if some translations on the page have l10n_source set to 0 whereas the l18n_parent is set to a correct value.

I do not know, if having different values in l18n_parent and l10n_source should be allowed or not. Researching points to the LocalizationRepository having a wrong while condition.

Reviews 2

Files 6

History 1130

Show 25 earlier messages
  1. Gerrit Code Review pushed patch set 1 for master to change 66905 status New Under Review <span data-processor="relativetime" data-value="2020-11-26T08:33:10+00:00" > 11/26/20, 08:33 </span>

  2. Christian Kuhn commented <span data-processor="relativetime" data-value="2021-03-25T14:06:50+00:00" > 03/25/21, 14:06 </span>

    Hey. I did not look at the pending patch in detail (yet), but I can elaborate on l18n_parent vs l10n_source a bit:

    • l18n_parent (which is usually l10n_parent – 8 vs. 0 – in tt_content that is for historical reasons) … anyway, the field that is referenced as “transOrigPointerField” in a TCA tables ‘ctrl’ section, has this meaning: It says that the content element is a localization of that default language content element referenced by the given id. So:
      • It is 0 for sys_language_uid = 0 and -1 default language content elements.
      • It is 0 for sys_language_uid > 1 content elements, if the content element is in “free / copy mode”. It means the element is ‘standalone’ and not directly connected to a default language element: default language and localization can have different content element structures.
      • It is ‘an-id-of-a-default-language-content-element’ in “connected mode” for sys_language_uid > 1 records: It says that this element is a direct localization of a given default language element.
      • l18n_parent never points to a content element that has sys_language_uid > 0 – it does not point to another localized content element … at least it shouldn’t, even though editors are (currently still) able to create this (which is not good).
      • There should be exactly 0 or 1 element for a given sys_language_uid that has this id: There must not be multiple content elements having the same sys_language_uid AND l18n_parent – It would mean there are two localizations of a default language element and that must not happen (and both page and list module then randomly ignore one of those).
    • l10n_source (tca ctrl translationSource): This is an indicator from which other content element this localization has been derived from.
      • It is 0 for sys_language_uid=0 content elements.
      • It is 0 for elements newly created in a non default language in free mode.
      • It is the id of a default-language content element if the element has been derived from that default language element. both in free and connected mode.
      • It is the id of a non-default-language record if this content element locolization has been derived from another non-default-language content element (localization-chains: de is a localization of default-language en, and fr is a localization of de)
    This allows the following combinations for any given non-default sys_language_uid > 0 element:
    • l18n_parent = 0 AND l10n_source = 0 -> The element is in free mode and has been created as a new standalone content element in this localization.
    • l18n_parent = 0 AND l10n_source = id -> The element is in free mode, but has been derived from some other element as ‘localization source’.
    • l18n_parent = id AND l10n_source = 0 -> shouldn’t happen / db inconsistency.
    • l18n_parent = id AND l10n_source = same-id -> The element is in connected mode and has been derived from the default language element.
    • l18n_parent = id AND l10n_source = other-id -> The element is in connected mode but has been derived from another element that is a localization of the default language element.

    Note there are some additional cases / combinations in workspaces …

  1. Andreas Kießling commented <span data-processor="relativetime" data-value="2022-10-12T15:09:46+00:00" > 10/12/22, 15:09 </span>

    > l18n_parent = id AND l10n_source = other-id -> The element is in connected mode but has been derived from another element that is a localization of the default language element.

    I seem to have that in a project: a page translation is in connected mode, but when i hit Translate again after new elements were added to default, i see a lot of elements that are already translated. When you just keep pressing next in the dialogue, you end up with elements that now have two translations.

  2. Markus Klein commented <span data-processor="relativetime" data-value="2023-11-24T08:02:20+00:00" > 11/24/23, 08:02 </span>

    > l18n_parent = id AND l10n_source = 0 -> shouldn’t happen / db inconsistency.

    I disagree on that one. An editor might change the parent via normal BE editing, but is not able to change the source. This is a valid action in the editor’s POV.

  3. Jo Hasenau commented <span data-processor="relativetime" data-value="2024-02-07T08:56:54+00:00" > 02/07/24, 08:56 </span>

    Markus Klein wrote in #note-19:
    > > l18n_parent = id AND l10n_source = 0 -> shouldn’t happen / db inconsistency.
    >
    > I disagree on that one. An editor might change the parent via normal BE editing, but is not able to change the source. This is a valid action in the editor’s POV.

    And this has to be changed, since it would be a DB inconsistency. Changing the value of l18n_parent must push that value to l10n_source too, if l10n_source was empty before. That’s exactly one of those issues we have to tackle with the upcoming TransFusion extension.

  4. Jo Hasenau commented <span data-processor="relativetime" data-value="2024-02-07T09:39:19+00:00" > 02/07/24, 09:39 </span>

    Andreas Kiessling wrote in #note-13:
    > > l18n_parent = id AND l10n_source = other-id -> The element is in connected mode but has been derived from another element that is a localization of the default language element.
    >
    > I seem to have that in a project: a page translation is in connected mode, but when i hit Translate again after new elements were added to default, i see a lot of elements that are already translated. When you just keep pressing next in the dialogue, you end up with elements that now have two translations.

    You should not be able to hit “translate” again, but it seems that related methods don’t properly check the values of those fields.
    i.e. BackendUtility::getLocalizedRecord() checks for

    $tcaCtrl['translationSource'] ?? $tcaCtrl['transOrigPointerField']

    which is the wrong order, since transOrigPointerField must have a higher priority.

  5. André Buchmann commented and changed attached clipboard-202503302226-py7go.png attached clipboard-202503302226-rnrmm.png attached clipboard-202503302227-aa1z9.png attached clipboard-202503302227-laifg.png attached clipboard-202503302257-z7r3k.png attached clipboard-202503302259-2auor.png <span data-processor="relativetime" data-value="2025-03-30T21:14:02+00:00" > 03/30/25, 21:14 </span>

    >> l18n_parent = id AND l10n_source = 0 -> shouldn’t happen / db inconsistency.
    >
    > I disagree on that one. An editor might change the parent via normal BE editing, but is not able to change the source. This is a valid action in the editor’s POV.

    I totally agree with @liayn . I don’t see it as a database inconsistency, as long as we support unconnected content elements (free mode) :-)

    Behaviour still reproducable without patch in dev-main (14.0). I’ve created two elements in the default language and one element in a translation (free mode). Then I’ve translated one element of the default language via the “New”-select in the content-element editor.

    Initial setup in List!

    Initial setup in “Page”. The translation button shows up with both elements:
    clipboard-202503302226-rnrmm.png

    The reconnected element with empty l10n_source is translated again:
    clipboard-202503302227-aa1z9.png

    Result:
    clipboard-202503302227-laifg.png

    —-

    With the patch, the translation button still shows up, but the wizard is empty:
    clipboard-202503302257-z7r3k.png

    Click on next, it crashes -> Fix needs to be improved:
    clipboard-202503302259-2auor.png

  6. Peter Kraume commented and changed TYPO3 Version 11 14 <span data-processor="relativetime" data-value="2026-10-16T08:45:16+00:00" > 10/16/26, 08:45 </span>

    I recently had this issue in TYPO3 v14 where the wizard suggested records for translation which were already translated. In the next step of the wizard, this caused a TYPO3 error.
    Patch set 19 worked well to fix the problem.