Issue Bug Under Review Stale

#110592CONTENT with recursive ignores content_from_pid when pidInList is this

Stefan Bürk 09/01/26, 21:15 updated 09/01/26, 22:32

Description

Problem

ContentObjectRenderer resolves the keyword “this” in “pidInList” in two
different places, using two different values.

In method getQuery the recursive expansion replaces a “this” entry with
the id of the current page, taken from the page information attribute,
before expanding the page tree and writing back a concrete pid list.

In method getQueryConstraints the keyword “this” is instead replaced by
the content pid of the page information. That value is the target of the
page property “Show content from page” (pages field content_from_pid) if
that field is set, and the current page id otherwise.

Effect

On a page which uses “Show content from page”, a CONTENT object with
pidInList = this behaves inconsistently:

  • Without recursive, the constraint resolves “this” to the configured
    content source page and records are fetched from there. That is the
    documented behaviour of the page property.
  • With recursive greater than zero, the expansion resolves “this” to the
    current page, expands the subtree of the current page and writes a
    concrete pid list. The constraint never sees the keyword anymore, so the
    configured content source page is ignored.

The page property “Show content from page” is therefore silently dropped
as soon as recursive is used, while it is respected without it.

Affected code

typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php,
method getQuery (recursive expansion) versus method getQueryConstraints.

The same code is present in main, 14.3 and 13.4. No functional test
covers the combination of content_from_pid and recursive.

Expected

Both places resolve the keyword consistently, so that a recursive
CONTENT object on a page with “Show content from page” fetches records
from the configured content source page and its subtree.

Reviews 1

History 14