Issue Bug Resolved

#110710Content element restrictions skipped for records on new pages

Stefan Bürk 09/15/26, 10:23 updated 09/29/26, 08:15

Description

Problem

The content element restrictions of backend layouts (allowedContentTypes and disallowedContentTypes of a colPos) are not applied to content elements whose pid is a placeholder of the same datamap:

  • a content element on a page which is created in the same datamap (pid NEW…),
  • a content element placed after a new content element (pid -NEW…).

Such content elements are saved regardless of the restrictions of the backend layout of their page.

Cause

DataHandlerContentElementRestrictionHook checks the datamap in processDatamap_beforeStart, before DataHandler has created any record. The placeholder pid is cast to the integer 0 there, so the backend layout of page 0 is used, which is the default layout without any restrictions.

How to reproduce

  1. Configure a backend layout with disallowedContentTypes = html for colPos 0, used by the sub pages of page 1 via backend_layout_next_level.
  2. Process one datamap with a new page below page 1 and a new tt_content record of CType html in colPos 0, using the NEW placeholder of that page as pid.
  3. The content element is created.

Expected: the content element is rejected with the “due to disallowed value(s)” log entry, as it is on an existing page.

Solution

Check the records in processDatamap_preProcessFieldArray instead. DataHandler processes the pages table first, so the placeholder resolves to the real page with its backend layout and TSconfig there, and a disallowed record is skipped before anything is written.

Affected since the content element restrictions were introduced with #108623 (TYPO3 v14.1).

Reviews 3

History 13

  1. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-29T08:15:10+00:00" > 09/29/26, 08:15 </span>

    Applied in changeset commit:9440b9fe2e87a5ef1ec726f938e693543c3ae2b5.