Project

General

Profile

Actions

Bug #105765

closed

Recursive Copy: Incorrect l10n_source for translated sub level pages - "Unused elements in language comparison"

Added by Denis Mir about 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
Start date:
2024-12-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #91752: Recursive Copy: Translation is created before Original PageResolved2020-07-06

Actions
Actions #1

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?

Actions #2

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.

Actions #3

Updated by Denis Mir about 2 months ago

  • Related to Bug #91752: Recursive Copy: Translation is created before Original Page added
Actions #4

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 :)

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

Updated by Benni Mack about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

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

Actions #13

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

Actions #14

Updated by Benni Mack about 1 month ago

  • Status changed from Under Review to Resolved
Actions

Also available in: Atom PDF