From ce28b6fffc5f1d3221fe47224b9e3c31ed524ec5 Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Mon, 16 Dec 2024 20:18:05 +0100 Subject: [PATCH] fix deprecated submission functions --- CoinsPlugin.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CoinsPlugin.php b/CoinsPlugin.php index 33a8c0c..8138a4d 100644 --- a/CoinsPlugin.php +++ b/CoinsPlugin.php @@ -77,15 +77,15 @@ function insertFooter(string $hookName, array $params) : bool ['ctx_ver', 'Z39.88-2004'], ['rft_id', $request->url(null, 'article', 'view', $article->getId())], ['rft_val_fmt', 'info:ofi/fmt:kev:mtx:journal'], - ['rft.language', $article->getLocale()], + ['rft.language', $article->getData('locale')], ['rft.genre', 'article'], ['rft.title', $journal->getLocalizedName()], ['rft.jtitle', $journal->getLocalizedName()], - ['rft.atitle', $article->getFullTitle($article->getLocale())], - ['rft.artnum', $article->getBestArticleId()], + ['rft.atitle', $publication->getFullTitles()[$article->getData('locale')]], + ['rft.artnum', $article->getBestId()], ['rft.stitle', $journal->getLocalizedSetting('abbreviation')], ]; - if ($issue) { + if ($issue) { $vars = array_merge($vars, [ ['rft.volume', $issue->getVolume()], ['rft.issue', $issue->getNumber()], @@ -94,12 +94,12 @@ function insertFooter(string $hookName, array $params) : bool $authors = $publication->getData('authors'); if ($firstAuthor = $authors->first()) { $vars = array_merge($vars, [ - ['rft.aulast', $firstAuthor->getFamilyName($article->getLocale())], - ['rft.aufirst', $firstAuthor->getGivenName($article->getLocale())], + ['rft.aulast', $firstAuthor->getFamilyName($article->getData('locale'))], + ['rft.aufirst', $firstAuthor->getGivenName($article->getData('locale'))], ]); } - $datePublished = $article->getDatePublished(); + $datePublished = $publication->getData('datePublished'); if (!$datePublished && $issue) { $datePublished = $issue->getDatePublished(); } @@ -115,8 +115,8 @@ function insertFooter(string $hookName, array $params) : bool if ($doi = $article->getStoredPubId('doi')) { $vars[] = ['rft_id', 'info:doi/' . $doi]; } - if ($article->getPages()) { - $vars[] = ['rft.pages', $article->getPages()]; + if ($publication->getData('pages')) { + $vars[] = ['rft.pages', $publication->getData('pages')]; } if ($journal->getSetting('printIssn')) { $vars[] = ['rft.issn', $journal->getSetting('printIssn')];