diff --git a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php index 7b81f6fe2d..73dc068607 100644 --- a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php +++ b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php @@ -51,9 +51,9 @@ public function __construct(LinkManagerInterface $link_manager, EntityResolverIn * {@inheritdoc} */ public function normalize($field_item, $format = NULL, array $context = []) { - // If this is not a content entity, let the parent implementation handle it, - // only content entities are supported as embedded resources. - if (!static::targetEntityIsContentEntity($field_item)) { + // If this is not a fieldable entity, let the parent implementation handle + // it, only fieldable entities are supported as embedded resources. + if (!static::targetEntityIsFieldable($field_item)) { return parent::normalize($field_item, $format, $context); } @@ -93,7 +93,7 @@ public function normalize($field_item, $format = NULL, array $context = []) { } /** - * Checks whether the referenced entity is of a content entity type. + * Checks whether the referenced entity is of a fieldable entity type. * * @param \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $ref * The reference field item whose target entity needs to be checked. @@ -105,7 +105,7 @@ public function normalize($field_item, $format = NULL, array $context = []) { * as the referencing entity's entity type. This will require looking up * that entity type's class via EntityTypeManager. Issue: */ - protected static function targetEntityIsContentEntity(EntityReferenceItem $ref) { + protected static function targetEntityIsFieldable(EntityReferenceItem $ref) { $target_entity = $ref->get('entity')->getValue(); if ($target_entity !== NULL) { return $target_entity instanceof FieldableEntityInterface;