Project

General

Profile

Actions

Bug #92937

open

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

Added by Markus Gerdes about 3 years ago. Updated 14 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
Start date:
2020-11-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #94397: Translation Button is shown in connected mode if l10n_source differs from l18n_parentClosed2021-06-22

Actions
Actions #1

Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #2

Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #3

Updated by Christian Kuhn almost 3 years ago

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 ...

Actions #4

Updated by Riccardo De Contardi over 2 years ago

  • Related to Bug #94397: Translation Button is shown in connected mode if l10n_source differs from l18n_parent added
Actions #5

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #6

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #7

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #8

Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #9

Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #10

Updated by Gerrit Code Review over 1 year ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #11

Updated by Gerrit Code Review over 1 year ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #12

Updated by Gerrit Code Review over 1 year ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #13

Updated by Andreas Kiessling over 1 year ago

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.

Actions #14

Updated by Gerrit Code Review 11 months ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #15

Updated by Gerrit Code Review 11 months ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #16

Updated by Gerrit Code Review 11 months ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #17

Updated by Gerrit Code Review 10 months ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #18

Updated by Gerrit Code Review 8 months ago

Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66905

Actions #19

Updated by Markus Klein 3 months ago

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.

Actions #20

Updated by Jo Hasenau 14 days ago

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.

Actions #21

Updated by Jo Hasenau 14 days ago

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.

Actions

Also available in: Atom PDF