Bug #105765
closedRecursive Copy: Incorrect l10n_source for translated sub level pages - "Unused elements in language comparison"
100%
Description
So we got the following problem. We tried to recursive copy a translated page with 1 level of sub pages. We saw that in the page modules language comparison view we got for the copied page translation all content elements marked as "unused elements".
This is the same behavior like here.
https://forge.typo3.org/issues/91752
A fix for the symptom is developed here -> https://review.typo3.org/c/Packages/TYPO3.CMS/+/71372
The reason for this behavior is the "l10n_source" for the copied translated page record is still set to the UID of the original default page record.
After some debugging I can say that the cause of this issue is in the DataHandler class in the method "\TYPO3\CMS\Core\DataHandling\DataHandler::int_pageTreeInfo".
The method tries to hand back a sorted list of page uids for a root pid.
Sorting is done with the "sorting" field. BUT the problem is that default page records and connected translated page records share the same "sorting" value. This leads to database engines picking the order depending on DB implementation internals.
This leads to the sorting that you can see in the added screenshot.
From the screenshot I can already tell you that "8809" and "8805" will get copied incorrectly with their copied translation page records getting the incorrect "l10n_source" set.
This is due to "$CPtable = $this->int_pageTreeInfo([], $uid, (int)$this->copyTree, $theNewRootID);" getting the incorrect order in "\TYPO3\CMS\Core\DataHandling\DataHandler::copyPages" and "\TYPO3\CMS\Core\DataHandling\DataHandler::copySpecificPage" getting now called in the wrong order. So the original translated page record gets copied before the original default record which finally leads to the incorrect "l10n_source".
In the end "\TYPO3\CMS\Core\DataHandling\DataHandler::int_pageTreeInfo" should in this case just take the "sys_language = 0" records into account which would solve the issue.
Files
Updated by Garvin Hicking about 2 months ago
- Status changed from New to Needs Feedback
I am not much involved in the issue, but if its the same issue and a patch exists, is having a new issue for this helpful or could you add this as a comment to the existing one?
Updated by Denis Mir about 2 months ago ยท Edited
The issue #91752 or better the related fix https://review.typo3.org/c/Packages/TYPO3.CMS/+/71372 do not fix the cause of the problem they just patch the symptom being the crashing page module.
The root problem is that while recursive copying some copied page translation records get the incorrect "l10n_source" set in the database. And this leads to the problem described in #91752 that the page module crashes (well it shows unused records) for this specific page translation record. So #91752 just fixes the symptom of the bug described here in #105765. I think the root cause should be fixed in the DataHandler as well. This is why I opened up the new ticket. I also commented this on the #91752.
Updated by Denis Mir about 2 months ago
- Related to Bug #91752: Recursive Copy: Translation is created before Original Page added
Updated by Garvin Hicking about 2 months ago
- Status changed from Needs Feedback to Accepted
Thanks for the explanation, I'll then leave this open for now and made a note in the gerrit patch :)
Updated by Gerrit Code Review about 1 month ago
- Status changed from Accepted to Under Review
Patch set 1 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/+/87452
Updated by Gerrit Code Review about 1 month ago
Patch set 2 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/+/87452
Updated by Gerrit Code Review about 1 month ago
Patch set 3 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/+/87452
Updated by Gerrit Code Review about 1 month ago
Patch set 4 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/+/87452
Updated by Gerrit Code Review about 1 month ago
Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87506
Updated by Gerrit Code Review about 1 month ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87507
Updated by Benni Mack about 1 month ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 73b6fdd2d8b6cbe9f78ed89e285e25291c3abe37.
Updated by Gerrit Code Review about 1 month ago
- Status changed from Resolved to Under Review
Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87507
Updated by Gerrit Code Review about 1 month ago
Patch set 3 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87507
Updated by Benni Mack about 1 month ago
- Status changed from Under Review to Resolved
Applied in changeset 1578898640ae3940645c475e4f8d4dfa821528ec.