core/modules/rest/src/Plugin/rest/resource/EntityResource.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index 4b4d027..6428cbb 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -145,7 +145,14 @@ public function patch(EntityInterface $original_entity, EntityInterface $entity // Overwrite the received properties. $langcode_key = $entity->getEntityType()->getKey('langcode'); + $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) { + continue; + } + $field = $entity->get($field_name); // It is not possible to set the language to NULL as it is automatically // re-initialized. As it must not be empty, skip it if it is.