- Issue created by @Tylermc
- last update
about 1 year ago 30,168 pass
When creating a resource through the JsonAPI using a post request, an error will occur if an entity has a custom UUID entity Key and the user will see the error:
Uncaught PHP Exception Drupal\Core\Entity\Query\QueryException: "'uuid' not found" at /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php line 369
1. Create a custom entity with a custom entity key to override the uuid key
2. Attempt to create a resource of that custom entity using Json API
The issue is in Drupal\jsonapi\Controller\EntityResource::entityExists
.
In this function it is using entity storage to load by the property 'uuid' instead of the entities uuid key
In the patch provided I have changed this to use the entity Repository in the class to use its function loadEntityByUuid which handles UUID array keys.
Active
11.0 🔥
Last updated