diff --git a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php index d2064fa..e1bfe4f 100644 --- a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php +++ b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php @@ -62,16 +62,9 @@ public function denormalize($data, $class, $format = NULL, array $context = []) $file_data = (string) $this->httpClient->get($data['uri'][0]['value'])->getBody(); $path = 'temporary://' . drupal_basename($data['uri'][0]['value']); - $data['uri'] = file_unmanaged_save_data($file_data, $path); + $data['uri'] = [file_unmanaged_save_data($file_data, $path)]; - $entity = $this->entityManager->getStorage('file')->create($data); - - // Pass the names of the fields whose values can be merged. - // @todo https://www.drupal.org/node/2456257 remove this. - unset($data['_links'], $data['_embedded']); - $entity->_restSubmittedFields = array_keys($data); - - return $entity; + return parent::denormalize($data, $class, $format, $context); } }