From 69d72dd3584677c812dead47952007605e0b4638 Mon Sep 17 00:00:00 2001 From: jyhein <124268211+jyhein@users.noreply.github.com> Date: Fri, 12 Apr 2024 12:58:26 +0300 Subject: [PATCH] Show locale in url in multilingual contexts --- GoogleScholarPlugin.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/GoogleScholarPlugin.php b/GoogleScholarPlugin.php index b066ceb..ec18a11 100644 --- a/GoogleScholarPlugin.php +++ b/GoogleScholarPlugin.php @@ -22,6 +22,7 @@ use APP\submission\Submission; use APP\template\TemplateManager; use PKP\citation\CitationDAO; +use PKP\core\PKPApplication; use PKP\db\DAORegistry; use PKP\plugins\GenericPlugin; use PKP\plugins\Hook; @@ -114,7 +115,7 @@ public function submissionView($hookName, $args) $authors = $publication->getData('authors'); foreach ($authors as $i => $author) { $templateMgr->addHeader('googleScholarAuthor' . $i, ''); - if ($affiliation = htmlspecialchars($author->getLocalizedData('affiliation', $publicationLocale))) { + if ($affiliation = htmlspecialchars($author->getLocalizedData('affiliation', $publicationLocale) ?? "")) { $templateMgr->addHeader('googleScholarAuthor' . $i . 'Affiliation', ''); } } @@ -168,7 +169,7 @@ public function submissionView($hookName, $args) } // Abstract URL - $templateMgr->addHeader('googleScholarHtmlUrl', ''); + $templateMgr->addHeader('googleScholarHtmlUrl', ''); // Abstract if ($abstract = $publication->getLocalizedData('abstract', $publicationLocale)) { @@ -199,9 +200,9 @@ public function submissionView($hookName, $args) $submissionFileId = $galley->getData('submissionFileId'); if ($submissionFileId && $submissionFile = Repo::submissionFile()->get($submissionFileId)) { if ($submissionFile->getData('mimetype') == 'application/pdf') { - $templateMgr->addHeader('googleScholarPdfUrl' . $i++, ''); + $templateMgr->addHeader('googleScholarPdfUrl' . $i++, ''); } elseif ($submissionFile->getData('mimetype') == 'text/html') { - $templateMgr->addHeader('googleScholarHtmlUrl' . $i++, ''); + $templateMgr->addHeader('googleScholarHtmlUrl' . $i++, ''); } } }