Issue Task Resolved

#111307Resolve page ancestry in the backend with one query

Benni Mack 11/01/26, 10:17 updated 11/01/26, 19:30

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

History 23

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

    Applied in changeset commit:fc9075cf362e3813415d55c4466bbbe89a6424d6.