diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index d04d272fe1a3762cfff5a5d6733534d6ffd9b138..6905ed938b43afd1378507c76ab7b178b3f5bd88 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -383,7 +383,6 @@ class UwNodeFieldValue { // Set the author to the person who made blog. $author = [ 'name' => $node->getOwner()->getDisplayName(), - 'link' => NULL, ]; } @@ -393,11 +392,11 @@ class UwNodeFieldValue { // Get the link field from the node. $link = $node->field_uw_author_link->getValue(); - // Set the author name and link (if any). - $author = [ - 'name' => $author_name, - 'link' => empty($link) ? NULL : $link[0]['uri'], - ]; + $author['name'] = $author_name; + + if (!empty($link)) { + $author['link'] = $link[0]['uri']; + } } return $author;