diff --git a/core/modules/hal/lib/Drupal/hal/Normalizer/EntityReferenceItemNormalizer.php b/core/modules/hal/lib/Drupal/hal/Normalizer/EntityReferenceItemNormalizer.php index e4f8162..64174d9 100644 --- a/core/modules/hal/lib/Drupal/hal/Normalizer/EntityReferenceItemNormalizer.php +++ b/core/modules/hal/lib/Drupal/hal/Normalizer/EntityReferenceItemNormalizer.php @@ -52,18 +52,6 @@ public function __construct(LinkManagerInterface $link_manager, EntityResolverIn } /** - * {@inheritdoc} - */ - public function supportsNormalization($data, $format = NULL) { - // Normalization is only supported if the referenced entity is a content - // entity. - if (parent::supportsNormalization($data, $format)) { - return $data->entity instanceof ContentEntityInterface; - } - return FALSE; - } - - /** * Implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize() */ public function normalize($field_item, $format = NULL, array $context = array()) { @@ -79,6 +67,10 @@ public function normalize($field_item, $format = NULL, array $context = array()) // Normalize the target entity. $embedded = $this->serializer->normalize($target_entity, $format, $context); + // @todo Config entities currently can not be serialized, skip them. + if (!$embedded) { + return array(); + } $link = $embedded['_links']['self']; // If the field is translatable, add the langcode to the link relation // object. This does not indicate the language of the target entity.