Browse Source

Fixing WSOD when term has no uri (#88)

pull/756/head
dannylamb 6 years ago committed by Natkeeran
parent
commit
247a438f80
  1. 6
      src/EventSubscriber/LinkHeaderSubscriber.php

6
src/EventSubscriber/LinkHeaderSubscriber.php

@ -203,9 +203,9 @@ abstract class LinkHeaderSubscriber implements EventSubscriberInterface {
$rel = "tag";
$entity_url = $referencedEntity->url('canonical', ['absolute' => TRUE]);
if ($referencedEntity->hasField('field_external_uri')) {
$external_uri = $referencedEntity->get('field_external_uri')->first()->getValue()['uri'];
if (!empty($external_uri)) {
$entity_url = $external_uri;
$external_uri = $referencedEntity->get('field_external_uri')->getValue();
if (!empty($external_uri) && isset($external_uri[0]['uri'])) {
$entity_url = $external_uri[0]['uri'];
}
}
$title = $referencedEntity->label();

Loading…
Cancel
Save