Review 12.4 Merged

87507[BUGFIX] Fix wrong sorting and l10n_source for copied pages

Benni Mack CR +2 V +2 Easy +4 −1 updated 12/19/24, 19:15

Commit message

First off: Huge thanks to Denis Mir who tracked down
the actual root of the problem.

Right now, there are various scenarios where
"l10n_source" and "l10n_parent" of pages are not the
same in a running installation, which is technically
not possible currently.

However, this happens when a page is copied with their
subpages, and the actual pages to be copied are selected.
In this case, TYPO3 had a bug which was caused by
incorrectly querying the actual pages to copy.

Since "pages" always need a record in the default language
(sys_language_uid=0), they are the ones to be copied, and
the translations are copied along.

However, the query was based to fetch also all translations
of a page as well, which share the same PID and sorting,
thus, resulting in different orderings (sorting) AND
thus, the l10n_source was wrongly filled.

This change finally fixes this issue properly.

In order for you to make sure this works on your machine,
EXT:dbdoctor should help. Or, if you aren't on a large
and sophisticated project without workspaces, this one
could also do the trick:

  "UPDATE pages SET l10n_source=l10n_parent WHERE sys_language_uid>0;"

Also please note that some sorting in translated records might
be wrong.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 3

Files 1

Review log 69

  1. Benni Mack commented on patch set 1 12/16/24, 12:44

    Cherry Picked from branch 13.4. The following files contain Git conflicts: * typo3/sysext/core/Tests/Functional/DataScenarios/Regular/AbstractActionTestCase.php * typo3/sysext/core/Tests/Functional/DataScenarios/Regular/WorkspacesDiscard/ActionTest.php * typo3/sysext/core/Tests/Functional/DataScenarios/Regular/WorkspacesModify/ActionTest.php * typo3/sysext/core/Tests/Functional/DataScenarios/Regular/WorkspacesPublish/ActionTest.php * typo3/sysext/core/Tests/Functional/DataScenarios/Regular/WorkspacesPublishAll/ActionTest.php
  2. core-ci voted on patch set 1 V -1 12/16/24, 12:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71189

  3. Benni Mack uploaded patch set 2 V -1 12/16/24, 13:43

  4. core-ci voted on patch set 2 V -1 12/16/24, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71194

  5. Benni Mack uploaded patch set 3 V -1 12/18/24, 21:08

  6. Benni Mack marked it ready for review 12/18/24, 21:08

  7. core-ci voted on patch set 3 V +1 12/18/24, 21:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71417

  8. Benni Mack voted on patch set 3 CR +2 V +2 12/19/24, 19:15

  9. Benni Mack merged patch set 4 12/19/24, 19:15