Closed (fixed)
Project:
Modeler API
Version:
1.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2026 at 19:02 UTC
Updated:
13 Mar 2026 at 16:36 UTC
Jump to comment: Most recent
I'm unsure how I got this, but attempting to uninstall the Modeler API module, it's possible to get a `null` passed into the entityTypeBuild() function.
Error: Call to a member function setListBuilderClass() on null in /modeler_api/src/Hook/EntityHooks.php on line 70 #0 /web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(118): Drupal\modeler_api\Hook\EntityHooks->entityTypeBuild()
#1 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(340): Drupal\Core\Entity\EntityTypeManager->Drupal\Core\Entity\{closure}()
#2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(117): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#3 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(216): Drupal\Core\Entity\EntityTypeManager->findDefinitions()
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(25): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#5 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(132): Drupal\Core\Plugin\DefaultPluginManager->getDefinition()
#6 /var/www/html/web/modules/contrib/eca/src/PluginManager/Action.php(100): Drupal\Core\Entity\EntityTypeManager->getDefinition()
#7 /var/www/html/web/core/lib/Drupal/Core/Action/ActionManager.php(38): Drupal\eca\PluginManager\Action->setCacheBackend()
#8 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\Core\Action\ActionManager->__construct()
#9 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
Check to make sure the $type exists before running that block.
Review and merge.
None
None
None
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
Comment #3
robloachMerge Request: https://git.drupalcode.org/project/modeler_api/-/merge_requests/18
Comment #4
jurgenhaasThanks @robloach for reporting this. I'm not sure, though, if the MR is really fixing that issue. This is because the code block looks like this:
The error occurred at
->setListBuilderClass(ListBuilder::class)according to your stack trace which means that->setAccessClass(AccessControlHandler::class)must have returned NULL, but$entity_types[$type]must have been available, otherwise the previous method call would have had to fail too.This is strange too because of the function declaration of
\Drupal\Core\Entity\EntityTypeInterface::setAccessClassshouldn't return NULL at all. Is this one of those problems that happen with uninstalling modules, something that should be necessary in real life?Comment #5
jurgenhaasWaiting for feedback, setting to NW in the meantime.
Comment #6
kristen polI just ran into this when trying to uninstall 1.2.8. But after running
drush un aiagain, it worked.Comment #7
jurgenhaas@kristen pol do you have a stack trace? The originally posted stack trace raised my questions in #4 and I wonder how that looked in your scenario.
Comment #8
jurgenhaasComment #9
kristen polHmm. This was so long ago 😅 I probably don’t have that set up anymore. Moving fast and breaking things these days!
Comment #10
robloachIt's likely from uninstalling a set of modules that were uninstalled in an unexpected order? I do not recall how I was able to get this error, but the safe-guards prevented the error from occurring.
Comment #13
jurgenhaasOK, I've now merged and backported this, as the safeguard doesn't hurt.
Comment #15
jurgenhaas