Issue Bug Under Review Stale

#110598PAGEVIEW resolves the page layout identifier twice

Stefan Bürk 09/02/26, 10:48 updated 09/03/26, 09:39

Description

Problem

PAGEVIEW determines the Fluid template of a page from the backend layout
identifier. It does not use the page layout that has already been
resolved for the request and is available from the page information.
Instead it asks PageLayoutResolver for the identifier a second time,
based on the page record and the root line.

The content areas that PAGEVIEW assigns to the view come from the
resolved page layout. Template name and content areas are therefore
taken from two independent resolutions of the same thing.

Effect

Both results can differ. A backend layout data provider decides which
layout an identifier resolves to, and it may return a layout carrying a
different identifier than the requested one. In that case PAGEVIEW
renders the template of the requested identifier while the content areas
belong to the layout that was actually resolved.

The duplicated resolution also hides the case where a layout identifier
is found but the layout definition for it can not be resolved: the
template is rendered as if the layout existed, while there are no
content areas at all.

Expected

The template is determined from the page layout that has been resolved
for the page, so template and content areas always describe the same
layout. If no page layout could be resolved, the previous behaviour is
kept as a fallback.

Affected code

typo3/sysext/frontend/Classes/ContentObject/PageViewContentObject.php

Related to the crash reported in issue #110596, which surfaces in the
same area.

Reviews 3

History 05