diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index 75e16a7..d6fdcd1 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -146,7 +146,7 @@ public function patch(EntityInterface $original_entity, EntityInterface $entity } // Overwrite the received properties. - $entity_keys = array_values($entity->getEntityType()->getKeys()); + $entity_keys = $entity->getEntityType()->getKeys(); foreach ($entity->_restSubmittedFields as $field_name) { $field = $entity->get($field_name); @@ -154,7 +154,7 @@ public function patch(EntityInterface $original_entity, EntityInterface $entity // identify the entity. Therefore it does not make sense to modify any of // them. However, rather than throwing an error, we just ignore them as // long as their specified values match their current values. - if (in_array($field_name, $entity_keys)) { + if (in_array($field_name, $entity_keys, TRUE)) { // Unchanged values for entity keys don't need access checking. if ($original_entity->get($field_name)->getValue() === $entity->get($field_name)->getValue()) { continue;