Review main Merged

97537[FEATURE] Find the subpages of a page with one database query

Benni Mack CR +2 V +2 Expert +1804 −659 updated 11/21/26, 09:34

Commit message

Several places walked the page tree in PHP with one query per
page, each handling workspaces, languages and permissions on its
own. The new PageDescendantsRepository fetches the descendants of
pages with one recursive common table expression, resolved for a
workspace, ordered depth-first, with access constraints handed in
by the caller.

The page tree repository, the workspaces module, Extbase backend
storage pids, the lowlevel query search, the recycler, the indexed
search administration, the page trees rendered by AbstractTreeView,
the pagetree overview, the link validator, and the slug update and
integrity check of redirects use it now. For 780 pages, this
reduces up to 907 queries to one.

When a slug is changed in a workspace, the slugs of subpages are
now updated from their workspace state, including pages moved
below the changed page in the workspace. Page trees show pages
moved in a workspace at their new position.

The record statistics report fetches all pages with one query and
builds the tree in PHP, visiting each page once. Records are
counted per page, so the uids of all pages are no longer sent to
the database, which exceeded the number of allowed placeholders in
large installations.

Review

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

Issues 6

Files 33

Show 13 more files

Review log 1925

  1. Benni Mack uploaded patch set 1 11/11/26, 11:24

  2. core-ci voted on patch set 1 V +1 11/11/26, 11:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114063

  3. Benni Mack uploaded patch set 2 V +1 11/11/26, 12:44

  4. core-ci voted on patch set 2 V +1 11/11/26, 12:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114073

  5. Benni Mack uploaded patch set 3 V +1 11/11/26, 14:48

  6. core-ci voted on patch set 3 V +1 11/11/26, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114102

  7. Benni Mack marked it ready for review 11/11/26, 15:01

  8. Benni Mack rebased onto patch set 4 V +1 11/11/26, 15:58

  9. Benni Mack marked it ready for review 11/11/26, 16:13

  10. core-ci voted on patch set 4 V +1 11/11/26, 16:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114116

  11. Wouter Wolters voted on patch set 4 CR +1 V +1 11/11/26, 21:17

  12. Oli Bartsch commented on patch set 4 11/14/26, 16:07

    I have created https://review.typo3.org/c/Packages/TYPO3.CMS/+/97654 which is a simple fix for the Database Integrity Check bug (109583). Seems this patch covers a lot more. Not sure if we could just accept the small bugfix and evaluate this afterwards. WDYT?
  13. Benni Mack commented on patch set 4 11/14/26, 16:43

    Reply

    yeah, this is my approach to do it right to never worry about broken setups anymore. The original report and the first patch by Stefan was about fixing an issue when a database is in corrupt state which I could not reproduce in a regular setup. I recommended to build a solution that its forward-looking than fixing a symptom. I can live ofc with your approach fixing the issue (again, only managed to reproduce it by manually changing things in my DB) and this one for a future change with a different issue number.
  14. Benni Mack uploaded patch set 5 CR +1 V +1 11/15/26, 08:27

  15. Benni Mack commented on patch set 5 11/15/26, 08:28

    Reply

    I changed the resolves line now to related, since your bugfix got in.
  16. core-ci voted on patch set 5 V +1 11/15/26, 08:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114513

  17. Wouter Wolters voted on patch set 5 CR +1 V +1 11/15/26, 11:34

  18. Simon Schaufelberger voted on patch set 5 CR +1 V +1 11/15/26, 15:28

  19. Josua Vogel voted on patch set 5 CR +1 V +1 11/16/26, 09:08

  20. Benni Mack uploaded patch set 6 CR +1 V +1 11/19/26, 08:41

  21. core-ci voted on patch set 6 V +1 11/19/26, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114975

  22. Benjamin Kott voted on patch set 6 CR +1 V +1 11/19/26, 10:07

  23. Josua Vogel voted on patch set 6 CR +1 V +1 11/19/26, 11:36

  24. Benni Mack voted on patch set 6 CR +2 V +2 11/21/26, 09:34

  25. Benni Mack merged patch set 7 11/21/26, 09:34