core/modules/rest/src/Plugin/rest/resource/EntityResource.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index 6428cbb..0477982 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -148,8 +148,9 @@ public function patch(EntityInterface $original_entity, EntityInterface $entity $bundle_key = $entity->getEntityType()->getKey('bundle'); foreach ($entity->_restSubmittedFields as $field_name) { // \Drupal\serialization\Normalizer\EntityNormalizer::denormalize() needs - // the bundle to be able to denormalize the entity. - if ($field_name === $bundle_key) { + // the bundle to be able to denormalize the entity, if the entity type has + // a bundle key. + if ($bundle_key && $field_name === $bundle_key) { continue; }