Skip to content

Commit

Permalink
Handled galley without a file
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed May 24, 2024
1 parent e567130 commit 33a26cd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions plugins/generic/htmlArticleGalley/HtmlArticleGalleyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,11 @@ public function articleViewCallback($hookName, $args)
{
$request = & $args[0];
$issue = & $args[1];
/** @var \PKP\galley\Galley */
$galley = & $args[2];
$article = & $args[3];

if (!$galley) {
return false;
}

$submissionFile = $galley->getFile();
/** @var ?Publication */
$galleyPublication = null;
if ($submissionFile->getData('mimetype') === 'text/html') {
if ($galley && $galley->getFileType() === 'text/html') {
/** @var ?Publication */
$galleyPublication = null;
foreach ($article->getData('publications') as $publication) {
Expand All @@ -107,7 +101,7 @@ public function articleViewCallback($hookName, $args)
'galley' => $galley,
'isLatestPublication' => $article->getData('currentPublicationId') === $galley->getData('publicationId'),
'galleyPublication' => $galleyPublication,
'submissionFile' => $submissionFile,
'submissionFile' => $galley->getFile(),
]);
$templateMgr->display($this->getTemplateResource('display.tpl'));

Expand Down

0 comments on commit 33a26cd

Please sign in to comment.