Browse Source

Update UriExtractor.php

3.1.x
JeroenT 4 years ago
parent
commit
a4531aefe3
  1. 5
      src/UriExtractor.php

5
src/UriExtractor.php

@ -43,11 +43,12 @@ class UriExtractor {
return self::getUriFromEntity($input); return self::getUriFromEntity($input);
} }
elseif ($input instanceof EntityReferenceFieldItemListInterface) { elseif ($input instanceof EntityReferenceFieldItemListInterface) {
if ($item = $input->first()) { $item = $input->first();
if (!empty($item) && $input->entity instanceof ContentEntityInterface) {
return $this->getUriFromEntity($item->entity); return $this->getUriFromEntity($item->entity);
} }
} }
elseif ($input instanceof EntityReferenceItem) { elseif ($input instanceof EntityReferenceItem && $input->entity instanceof ContentEntityInterface) {
return self::getUriFromEntity($input->entity); return self::getUriFromEntity($input->entity);
} }
return NULL; return NULL;

Loading…
Cancel
Save