Review 13.4 Merged

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

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

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
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 4

Review log 34

  1. Stefan Bürk commented on patch set 1 05/05/25, 07:42

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 05/05/25, 07:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78511

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 05/05/25, 07:50

  4. Stefan Bürk merged patch set 2 05/05/25, 07:51