Problem/Motivation
I get the TypeError on attempt to launch php core/scripts/drupal server
command in a project with a module implementing hook_entity_base_field_info
, though I think the problem is in the hook system (it seems like the .module
file is not loaded when the hook is being invoked).
TypeError: Drupal\Core\Entity\EntityFieldManager::{closure:Drupal\Core\Entity\EntityFieldManager::buildBaseFieldDefinitions():294}(): Argument #1 ($hook) must be of type callable, string given, called in /app/core/lib/Drupal/Core/Extension/ModuleHandler.php on line 315 in /app/core/lib/Drupal/Core/Entity/EntityFieldManager.php on line 294
Full backtrace is attached in a file.
Steps to reproduce
Linux Mint, PHP 8.4.2 - 8.4.5, Composer 2.8.8, SQLite 3.45.1, Drupal 11.1.6 to the latest dev 11.x
git clone --branch 11.x --depth 1 https://git.drupalcode.org/project/drupal.git .
composer install
composer require drush/drush drupal/token
php core/scripts/drupal quick-start --suppress-login minimal
# Ctrl+C to stop the server for now.
vendor/bin/drush en token
php core/scripts/drupal server --suppress-login
The token module is just an example module implementing the necessary hook to reproduce the issue (entity_base_field_info
in this case).
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet