Error when creating Entity using POST in the RESTful entity type created in the ECK module: multiple entity types found.

Created on 7 September 2025, 26 days ago

The entity types created using modules like ECK report this error because multiple entity types use the same class file, while the Jsonapi module does not have this error.

Drupal\Core\Entity\Exception\AmbiguousEntityClassException:Drupal\Core\Entity\EntityTypeRepository->getEntityTypeFromClass() in Multiple entity types found for Drupal\eck\Entity\EckEntity. (/www/wwwroot/web/core/lib/Drupal/Core/Entity/EntityTypeRepository.php The 83rd line).

#0 /www/wwwroot/web/core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php(54): Drupal\Core\Entity\EntityTypeRepository->getEntityTypeFromClass()
#1 /www/wwwroot/web/core/modules/serialization/src/Normalizer/EntityNormalizer.php(39): Drupal\serialization\Normalizer\EntityNormalizer->determineEntityTypeId()
#2 /www/wwwroot/vendor/symfony/serializer/Serializer.php(240): Drupal\serialization\Normalizer\EntityNormalizer->denormalize()
#3 /www/wwwroot/web/core/modules/rest/src/RequestHandler.php(179): Symfony\Component\Serializer\Serializer->denormalize()
#4 /www/wwwroot/web/core/modules/rest/src/RequestHandler.php(67): Drupal\rest\RequestHandler->deserialize()
#5 [internal function]: Drupal\rest\RequestHandler->handle()
#6 /www/wwwroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#7 /www/wwwroot/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}()
#8 /www/wwwroot/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()

🐛 Bug report
Status

Active

Version

11.2 🔥

Component

rest.module

Created by

🇨🇳China qiutuo

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024