Skip to content

Commit

Permalink
Handled galley without a file
Browse files Browse the repository at this point in the history
(cherry picked from commit 33a26cd)
  • Loading branch information
jonasraoni committed May 24, 2024
1 parent 66c4e56 commit e9ce856
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 e9ce856

Please sign in to comment.