Review main Merged

89287[BUGFIX] Respect mounted pages in `RootlineUtility` correctly

Stefan Bürk CR +2 V +2 Normal +118 −4 updated 05/05/25, 07:50

Commit message

With #104506 the `RootlineUtility` has been refactored to use
`Recursive Common Table Expression` to reduce the count of
dispatched database queries. However, TYPO3 has the concept
of mounted pages within the page tree, which was not build
into the `CTE` query and handled on the PHP side traversing
the results and splicing sub rootlines into the mix when a
mounted page has been hit.

Even having a handful of mountpage related tests in place,
it was not detected that in some setups the retrieved page
rootline for mounted pages was not correct (#106375).

The issue relates to the order of the retrieved page records
for the rootline directly replacing the "mounted page" and
dropping the rest of the rootline, except the current page
record added again at a later point when site root pages are
mounted. Other tests related to mountpoints provided setups
having the mounted page on the other end of the rootline and
literally hiding the cutting away.

To mitigate the now detected issue some functional tests
based on provided DDEV example has been added to verified
working state within TYPO3 v12 and acting as a baseline.

Solving the issue requires to ...

* sort retrieved rootline records based on the calculated
  `CTE level` in ascending order.
* not sort retrieved sub rootine for mounted pages anymore.
* reverse retrieved rootline records in `getRootlineRecords`
  to allow correct splicing in `generateRootlineCache`, both
  aforementioned methods in `RootlineUtility`.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Anja Leichsenring +1
    • Andreas Kienast +1
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Anja Leichsenring +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 4

Review log 1117

  1. Stefan Bürk uploaded patch set 1 05/02/25, 10:17

  2. Stefan Bürk uploaded patch set 2 05/02/25, 10:20

  3. core-ci voted on patch set 1 V -1 05/02/25, 10:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78439

  4. core-ci voted on patch set 2 V -1 05/02/25, 10:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78440

  5. Stefan Bürk uploaded patch set 3 V -1 05/02/25, 11:04

  6. core-ci voted on patch set 3 V -1 05/02/25, 11:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78441

  7. Stefan Bürk uploaded patch set 4 V -1 05/02/25, 11:38

  8. core-ci voted on patch set 4 V +1 05/02/25, 11:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78443

  9. Stefan Bürk updated the commit message in patch set 5 V +1 05/02/25, 11:51

  10. core-ci voted on patch set 5 V +1 05/02/25, 11:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78444

  11. Oliver Klee updated the commit message in patch set 6 V +1 05/02/25, 12:29

  12. core-ci voted on patch set 6 V +1 05/02/25, 12:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78445

  13. Benni Mack voted on patch set 6 CR +1 V +1 05/04/25, 08:08

  14. Anja Leichsenring voted on patch set 6 CR +1 V +1 05/05/25, 05:34

  15. Andreas Kienast commented on patch set 6 CR +1 05/05/25, 07:20

    RootlineUtility.php:798

    nitpick: typo
  16. Stefan Bürk commented on patch set 6 CR +2 V +2 05/05/25, 07:42

    RootlineUtility.php:798 Reply

    Need to work on the cte implementation the next time anyway, have added it already to the stash to fix it along with the next change. Thanks for mentioning it.
  17. Stefan Bürk merged patch set 7 05/05/25, 07:50