Issue Task Resolved

#111300Extract page ancestry CTE from RootlineUtility into a reusable service

Benni Mack 10/31/26, 10:47 updated 11/01/26, 10:15

Description

RootlineUtility resolves the rootline of a page, including workspace overlays, with a single recursive common table expression (CTE) since #104506. The CTE is however locked into RootlineUtility, which also handles mount points, language overlays and relation resolving for the frontend.

The backend still uses BackendUtility::BEgetRootLine(), which executes one query per page level, plus additional workspace overlay queries per level in a workspace. Callers like BackendUserAuthentication::isInWebMount(), BackendUtility::readPageAccess(), getRecordPath() and getPagesTSconfig() walk the same rootline several times per request, as the runtime cache is keyed by the given where clause.

As a first step, the recursive CTE is moved into an internal service PageAncestryRepository. It returns the workspace-resolved page records from the given page up to the root level, without language overlays, mount point handling or access restrictions besides the deleted flag. RootlineUtility uses this service, so the frontend behaviour does not change.

This allows a backend service in a follow-up, which resolves the ancestry of a page as Page objects together with the effective permissions of a backend user using one database query, and eventually replaces BackendUtility::BEgetRootLine().

Reviews 3

History 12

  1. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-01T10:15:25+00:00" > 11/01/26, 10:15 </span>

    Applied in changeset commit:2cfed3bb090fa2ceb48fda6aaec42be029b8756e.