Problem

Enabling the Page Manager module on Drupal 11 causes a fatal error during container rebuild/module installation.

The issue occurs immediately when enabling:

`page_manager`
`page_manager_ui`

The following exception is thrown:

InvalidArgumentException: Class "page_manager_entity_type_build" does not exist.
in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition()

This appears to be related to `hook_entity_type_build()` implementations being incorrectly resolved as service/class callables during Drupal 11 container compilation.

---

Steps to reproduce

1. Install Drupal 11 (DDEV + Docker on Windows)
2. Install Page Manager:

ddev composer require drupal/page_manager:4.x-dev

3. Enable dependencies:

ddev drush en ctools -y

4. Attempt to enable Page Manager:

ddev drush en page_manager page_manager_ui -y

(OR Install all 3 modules manually from the UI)
---

Actual result

Drupal throws a fatal error:

InvalidArgumentException: Class "page_manager_entity_type_build" does not exist.

Stack trace points to:

Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition()
Drupal\Core\Extension\ModuleHandler->getHookImplementationList()
Drupal\Core\Entity\EntityTypeManager->findDefinitions()

---

Expected result

Modules should install successfully on Drupal 11 without fatal errors.

Environment

Drupal core: 11.x
Page Manager: 4.x-dev
CTools: latest compatible release
PHP: 8.3
Environment: Docker + DDEV

Additional investigation

The following hook implementations exist:

grep -R "entity_type_build" web/modules/contrib/page_manager

Output:

web/modules/contrib/page_manager/page_manager.module:
function page_manager_entity_type_build(array &$entity_types)

web/modules/contrib/page_manager/page_manager_ui/page_manager_ui.module:
function page_manager_ui_entity_type_build(array &$entity_types)

Possible cause

Drupal 11 may now treat some hook callback definitions differently during entity discovery/container compilation, causing procedural hook implementations to be interpreted as service class names.

CommentFileSizeAuthor
#2 Screenshot 2026-05-11 160451.png107.25 KBhiramanpatil
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hiramanpatil created an issue. See original summary.

hiramanpatil’s picture

StatusFileSize
new107.25 KB

akashkumar07 made their first commit to this issue’s fork.

akashkumar07’s picture

Status: Active » Needs review

Please review the MR changes. Thanks!