From 216295aae0f01e431e319b84a7b832b0119ecfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti-Jussi=20Nyg=C3=A5rd?= Date: Wed, 4 Dec 2024 07:49:49 +0200 Subject: [PATCH] Fix notice in OMP --- OpenGraphPlugin.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenGraphPlugin.inc.php b/OpenGraphPlugin.inc.php index ec02717..bf29b0f 100644 --- a/OpenGraphPlugin.inc.php +++ b/OpenGraphPlugin.inc.php @@ -116,9 +116,11 @@ function submissionView($hookName, $args) { if ($contextPageHeaderLogo = $context->getLocalizedData('pageHeaderLogoImage')){ $openGraphImage = $templateMgr->getTemplateVars('publicFilesDir') . "/" . $contextPageHeaderLogo['uploadName']; } - if ($issue && $issueCoverImage = $issue->getLocalizedCoverImageUrl()){ + + if (isset($issue) && $issueCoverImage = $issue->getLocalizedCoverImageUrl()){ $openGraphImage = $issueCoverImage; } + if ($submissionCoverImage = $submission->getCurrentPublication()->getLocalizedCoverImageUrl($submission->getData('contextId'))){ $openGraphImage = $submissionCoverImage; }