#110710Content element restrictions skipped for records on new pages
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
- Configure a backend layout with disallowedContentTypes = html for colPos 0, used by the sub pages of page 1 via backend_layout_next_level.
- 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.
- 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
-
Gerrit Code Review pushed patch set 1 for main to change 95852 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-15T10:34:29+00:00" > 09/15/26, 10:34 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 95855 <span data-processor="relativetime" data-value="2026-09-15T13:01:56+00:00" > 09/15/26, 13:01 </span>
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %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.