getEntityClass() must be of the type string, null returned

Created on 22 January 2022, about 3 years ago
Updated 3 December 2023, over 1 year ago

Problem/Motivation

After update I randomly get this error, but did not create any bundle classes. One time it loads the entity, other time it does not load the same entity. I will update issue as I understand more why this is happening.

TypeError: Return value of Drupal\Core\Entity\EntityStorageBase::getEntityClass() must be of the type string, null returned in Drupal\Core\Entity\EntityStorageBase->getEntityClass() (line 115 of /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
#0 /web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(196): Drupal\Core\Entity\EntityStorageBase->getEntityClass()
#1 /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(508): Drupal\Core\Entity\ContentEntityStorageBase->getEntityClass()
#2 /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(427): Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords()
#3 /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(393): Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage()
#4 /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(346): Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple()
#5 /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(296): Drupal\Core\Entity\EntityStorageBase->loadMultiple()
#6 ...: Drupal\Core\Entity\EntityStorageBase->load()

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.1

Component
Entity 

Last updated about 17 hours ago

Created by

🇱🇹Lithuania mindaugasd

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada joseph.olstad

    Drupal 11.1.1
    key module 1.x-dev latest as of today
    key module 1.19 also affected
    symfony mailer lite: 2.0.2

    Operation: add a key-override for the smtp username and smtp password of the symfony mailer transport configuration.

    The path of the request: /admin/config/development/configuration/key-overrides/add?ajax-form

    Same exact error as illustrated above:

    TypeError: Return value of Drupal\Core\Entity\EntityStorageBase::getEntityClass() must be of the type string, null

Production build 0.71.5 2024