Review main Merged

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

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

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
    • Oli Bartsch +1
    • Garvin Hicking +1
    • Christian Kuhn +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Garvin Hicking +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 3

Files 12

Review log 1115

  1. Benni Mack uploaded patch set 1 12/11/24, 16:44

  2. core-ci voted on patch set 1 V +1 12/11/24, 16:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70959

  3. Garvin Hicking voted on patch set 1 CR +1 V +1 12/11/24, 17:38

  4. Benni Mack uploaded patch set 2 CR +1 V +1 12/11/24, 18:41

  5. core-ci voted on patch set 2 V -1 12/11/24, 18:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70976

  6. Benni Mack uploaded patch set 3 V -1 12/11/24, 18:57

  7. Benni Mack rebased onto patch set 4 12/11/24, 18:58

  8. core-ci voted on patch set 3 V +1 12/11/24, 19:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70978

  9. core-ci voted on patch set 4 V +1 12/11/24, 19:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70979

  10. Garvin Hicking voted on patch set 4 CR +1 V +1 12/12/24, 07:21

  11. Oli Bartsch voted on patch set 4 CR +1 V +1 12/12/24, 07:34

  12. Simon Schaufelberger voted on patch set 4 CR +1 V +1 12/12/24, 09:56

  13. Christian Kuhn voted on patch set 4 CR +1 12/12/24, 11:30

  14. Benni Mack voted on patch set 4 CR +2 V +2 12/16/24, 12:13

  15. Benni Mack merged patch set 5 12/16/24, 13:37