Skip to content

Commit

Permalink
pkp/pkp-lib#9265 Fix fatal error on preview of unpublished content
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Aug 29, 2023
1 parent b4e56be commit e679ae0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CoinsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ function insertFooter(string $hookName, array $params) : bool
['rft.atitle', $article->getFullTitle($article->getLocale())],
['rft.artnum', $article->getBestArticleId()],
['rft.stitle', $journal->getLocalizedSetting('abbreviation')],
['rft.volume', $issue->getVolume()],
['rft.issue', $issue->getNumber()],
];

if ($issue) {
$vars = array_merge($vars, [
['rft.volume', $issue->getVolume()],
['rft.issue', $issue->getNumber()],
]);
}
$authors = $publication->getData('authors');
if ($firstAuthor = $authors->first()) {
$vars = array_merge($vars, [
Expand All @@ -97,7 +100,7 @@ function insertFooter(string $hookName, array $params) : bool
}

$datePublished = $article->getDatePublished();
if (!$datePublished) {
if (!$datePublished && $issue) {
$datePublished = $issue->getDatePublished();
}

Expand Down

0 comments on commit e679ae0

Please sign in to comment.