#111307Resolve page ancestry in the backend with one query
Description
BackendUtility::BEgetRootLine() executes one query per page level, plus additional workspace overlay queries per level in a workspace. Callers like BackendUserAuthentication::isInWebMount(), which is used by most permission checks in the backend, walk the same rootline several times per request, as the runtime cache is keyed by the given where clause.
With the page ancestry CTE now available as PageAncestryRepository (#111300) and the permission settings available from Page objects (#111301), a new PageAncestryResolver resolves the ancestry of a page in a workspace with one query. The resulting PageAncestry is ordered from the page to the root level, creates Page objects lazily, and provides the permission settings of the live pages. A broken or circular page tree results in an incomplete ancestry instead of an exception, and pages deleted in the workspace stay part of the ancestry, as with BEgetRootLine().
The following callers are migrated:
- BackendUserAuthentication::isInWebMount() (default permission clause, no getPagePermsClause hook registered)
- BackendUtility::getPagesTSconfig()
- IncludeTreeConditionMatcherVisitor (TSconfig conditions)
- SlugHelper::resolveParentPageRecord()
- DatabasePageRootline (FormEngine)
For a page on level seven, isInWebMount() needs 2 instead of 8 queries in live and 3 instead of 12 queries in a workspace.
Remaining callers of BackendUtility::BEgetRootLine() can be migrated afterwards, before the method gets deprecated.
Reviews 7
- main 97323[TASK] Check page access along the cached page ancestry
- main 97642[TASK] Build the record path of a page along the cached page ancestry
- main 97431[TASK] Use page ancestry for TypoScript rootlines in the backend
- main 97425[TASK] Resolve page context, site and previews along the ancestry
- main 97315[TASK] Use page ancestry for TSconfig, page tree and module rootlines
- main 97319[BUGFIX] Resolve pages new in a workspace along their workspace ancestry
- main 97274[TASK] Resolve page ancestry in the backend with one query
Related issues 1
History 23
-
Gerrit Code Review pushed patch set 1 for main to change 97274 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-01T10:18:46+00:00" > 11/01/26, 10:18 </span> -
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-01T19:30:17+00:00" > 11/01/26, 19:30 </span> -
Benni Mack changed Related to #111327 <span data-processor="relativetime" data-value="2026-11-03T09:53:58+00:00" > 11/03/26, 09:53 </span>
Applied in changeset commit:fc9075cf362e3813415d55c4466bbbe89a6424d6.