Skip to content

Adding a new content element can fail with "Undefined array key 'allowedContentTypes'" in ManipulateBackendLayoutColPosConfigurationForPage #737

@einpraegsam

Description

@einpraegsam

When creating a new content element via the page module, the b13/container listener ManipulateBackendLayoutColPosConfigurationForPage can throw a PHP warning that escalates to an exception in the TYPO3 backend, blocking the form from opening:

TYPO3\CMS\Core\Error\Exception (1476107295)
PHP Warning: Undefined array key "allowedContentTypes" in vendor/b13/container/Classes/Listener/ManipulateBackendLayoutColPosConfigurationForPage.php line 46

The issue is conditional on an unlucky uid collision and reproduces reliably for us on TYPO3 14.3 / b13/container 4.0.0 / PHP 8.5.

Steps to reproduce

  1. Have a container content element with at least one child (so tt_content row uid=N has tx_container_parent > 0 and colPos matching the registered grid column, e.g. 51).
  2. On the same TYPO3 instance, navigate the page module to a page whose page uid equals N (i.e. same numeric value as the child's uid in step 1).
  3. Click Create new content element in any non-container column on that page (e.g. colPos=0).
  4. The backend redirects to the edit form URL with edit[tt_content][N]=new and the exception is rendered instead of the form.

A quick patch that does the trick for us:

fix-listener-new-command-and-missing-keys.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions