Review 13.4 Merged

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

Benni Mack CR +2 V +2 Hard +353 −2 updated 12/16/24, 13:38

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 12

Review log 34

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

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 12/16/24, 12:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71188

  3. Benni Mack voted on patch set 1 CR +2 V +2 12/16/24, 13:38

  4. Benni Mack merged patch set 2 12/16/24, 13:38