#105765Recursive Copy: Incorrect l10n_source for translated sub level pages - "Unused elements in language comparison"
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.
Reviews 4
Related issues 1
Files 1
History 715
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2024-12-04T22:34:23+00:00" > 12/04/24, 22:34 </span> -
Denis Mir commented <span data-processor="relativetime" data-value="2024-12-05T07:11:16+00:00" > 12/05/24, 07:11 </span>
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.
-
Denis Mir changed Related to #91752 <span data-processor="relativetime" data-value="2024-12-05T08:28:32+00:00" > 12/05/24, 08:28 </span>
-
Garvin Hicking commented and changed status
Needs FeedbackAccepted <span data-processor="relativetime" data-value="2024-12-05T09:24:12+00:00" > 12/05/24, 09:24 </span>Thanks for the explanation, I’ll then leave this open for now and made a note in the gerrit patch :)
-
Gerrit Code Review pushed patch set 1 for main to change 87452 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2024-12-11T16:44:10+00:00" > 12/11/24, 16:44 </span> -
Gerrit Code Review pushed patch set 2 for main to change 87452 <span data-processor="relativetime" data-value="2024-12-11T18:42:00+00:00" > 12/11/24, 18:42 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 87452 <span data-processor="relativetime" data-value="2024-12-11T18:57:55+00:00" > 12/11/24, 18:57 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 87452 <span data-processor="relativetime" data-value="2024-12-11T18:58:51+00:00" > 12/11/24, 18:58 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87506 <span data-processor="relativetime" data-value="2024-12-16T12:13:47+00:00" > 12/16/24, 12:13 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 87507 <span data-processor="relativetime" data-value="2024-12-16T12:44:57+00:00" > 12/16/24, 12:44 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-12-16T13:40:12+00:00" > 12/16/24, 13:40 </span>Applied in changeset commit:73b6fdd2d8b6cbe9f78ed89e285e25291c3abe37.
-
Gerrit Code Review pushed patch set 2 for 12.4 to change 87507 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2024-12-16T13:43:30+00:00" > 12/16/24, 13:43 </span> -
Gerrit Code Review pushed patch set 3 for 12.4 to change 87507 <span data-processor="relativetime" data-value="2024-12-18T21:08:45+00:00" > 12/18/24, 21:08 </span>
-
Benni Mack commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2024-12-19T19:20:10+00:00" > 12/19/24, 19:20 </span>Applied in changeset commit:1578898640ae3940645c475e4f8d4dfa821528ec.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-08-12T14:36:30+00:00" > 08/12/25, 14:36 </span>
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?