Skip to content

Commit

Permalink
feat(YSP-721): only append author if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dblanken-yale committed Dec 16, 2024
1 parent 37e6563 commit ba899fd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public function build() {
$publishDate = strtotime($node->field_publish_date->first()->getValue()['value']);
$dateFormatted = $this->dateFormatter->format($publishDate, '', 'c');
$post_authors = $this->getPostAuthorLinks($node->field_authors);
array_push($post_authors, ['title' => $author, 'url' => NULL, 'isLink' => FALSE]);
if ($author) {
array_push($post_authors, ['title' => $author, 'url' => NULL, 'isLink' => FALSE]);
}
}

return [
Expand Down

0 comments on commit ba899fd

Please sign in to comment.