Bug #83469
closedTranslation of translations break sorting in tt_content
100%
Description
I am able to reconstruct an issue with translation handling, in latest TYPO3 7.6 and 8.7!
I've got three languages (one is default).
When I translate from default to e.g. english using the strict translate mode, everything is fine.
When I translate from english to e.g. italian, the elements are created, but the order of items is wrong. And because of strict mode, you can't move them.
Is this a regression bug?
In 7.6 also the wizard displays the order wrong, before the tt_content items are created.
In 8.7 the wizard displays it correctly, but the order of created items, is wrong. (edited)
When I use default as base to translate, the order is correct.
Screenshot: https://slack-files.com/T024TUMLZ-F8N2MHG6Q-8e2d722cf3
Files
Updated by Armin Vieweg almost 7 years ago
- Related to Bug #73617: Sorting of translation-copy different from original added
Updated by Susanne Moog almost 7 years ago
- Category set to DataHandler aka TCEmain
Updated by Andreas Wolf almost 7 years ago
Armin, I suspect that this might be the same bug that is fixed by https://review.typo3.org/#/c/53739/. Could you be so kind and check that? :)
Updated by Armin Vieweg almost 7 years ago
- File 2018-01-31_0904.png 2018-01-31_0904.png added
Hey Andreas, I've checked it, and the behaviour is still the same :/
Updated by Armin Vieweg almost 7 years ago
- File 2018-01-31_0927.png 2018-01-31_0927.png added
I debugged a little bit. And this is the $cmd which is passed to DataHandler:
The order looks good to me.
The uids 5, 6 and 7 are the german A, B and C records.
Updated by Armin Vieweg almost 7 years ago
- File 2018-01-31_0940.png 2018-01-31_0940.png added
\TYPO3\CMS\Core\DataHandling\DataHandler::localize breaks sorting somewhere:
Updated by Armin Vieweg almost 7 years ago
I've digged into the getSortNumber method and tried to understand what happens.
So the mayor difference, is that the records used for calculating the sortNumber are differently selected.
When I translate three content elements from default language:
1. Checks sorting from first default record ($row
) and its next sibling ($subrow
)
2. Calculates new sortNumber ($sortNumber = $row[$sortRow] + floor(($subrow[$sortRow] - $row[$sortRow]) / 2);
)
3. Create new translation record with calculated sortNumber
4. For the second record to translate, it compares the recently created record ($row) with the original sibling ($subrow), calulates and create new translated record
5. For the last record it also uses the recently created translated record and compares it still with the original sibling
When translating from a foreign language it behaves the same, but for the last record it uses NOT the latest translated record as $row, it uses the one before. The $subrow is the sibling of the latest translated record, which is (in this case, because of 3 items) the recently created translated record.
Long story short: I guess this happens because of negative PID voodoo. The pid is the only criteria used to calculate the sortNumber (besides existing sortNumbers itself). And localize in DataHandler seems to set pid to a negative value, which affects the sorting algorithm.
Updated by Armin Vieweg almost 7 years ago
Okay. After debugging a lot, I've found the point where it goes wrong:\TYPO3\CMS\Core\DataHandling\DataHandler::getPreviousLocalizedRecordUid
In the query just default language is checked, to fetch sortings of records.
When you enter the $language variable, it works.
For translations from default AND from foreign language.
Updated by Gerrit Code Review almost 7 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/55508
Updated by Gerrit Code Review almost 7 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/55508
Updated by Gerrit Code Review almost 7 years ago
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/55509
Updated by Gerrit Code Review almost 7 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/55509
Updated by Gerrit Code Review almost 7 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/55486
Updated by Gerrit Code Review almost 7 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/55508
Updated by Gerrit Code Review almost 7 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/55508
Updated by Riccardo De Contardi almost 7 years ago
- Related to Bug #81220: Translation from a language results in wrong sorting of CEs added
Updated by Gerrit Code Review almost 7 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/55508
Updated by Gerrit Code Review almost 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Gerrit Code Review over 6 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Gerrit Code Review over 6 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Gerrit Code Review over 6 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Gerrit Code Review over 6 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Gerrit Code Review over 6 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Tymoteusz Motylewski over 6 years ago
- Related to Bug #83079: wrong sorting of content elements when translating using non-default-language CEs as source added
Updated by Tymoteusz Motylewski over 6 years ago
- Related to Bug #68040: Inline localize and/or synchronize does not respect sorting added
Updated by Gerrit Code Review almost 6 years ago
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55508
Updated by Daniel Goerz about 5 years ago
- Status changed from Under Review to Closed
Closed as duplicate of https://forge.typo3.org/issues/83079
Please continue there.
Updated by Gerrit Code Review about 3 years ago
- Status changed from Closed to Under Review
Patch set 32 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/+/54750
Updated by Gerrit Code Review about 3 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72254
Updated by Christian Kuhn about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 23910371cb616ed0647ad4daa232be0ad9816c11.
Updated by Christian Kuhn almost 3 years ago
- Related to Bug #78220: Translate mode copy does not respect order added
Updated by Christian Kuhn almost 3 years ago
- Related to Bug #81328: Translation didn't sort Elements correct. added
Updated by Christian Kuhn almost 3 years ago
- Related to Bug #93968: false order of localized CE in BE view / "Translate" button is shown but no translateable CE are available added
Updated by Christian Kuhn almost 3 years ago
- Related to Bug #86059: Wrong sorting for localized entries in page module with 8.7.16 and higher added