From 7cf003736194c758e431cfeff7ffb76e6a0d4dce Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Tue, 17 Dec 2024 13:10:44 +0100 Subject: [PATCH] pkp/pkp-lib#10726 consider all existing submission metadata langauges --- OAIMetadataFormat_JATS.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/OAIMetadataFormat_JATS.php b/OAIMetadataFormat_JATS.php index 8f826a1..06f1eba 100644 --- a/OAIMetadataFormat_JATS.php +++ b/OAIMetadataFormat_JATS.php @@ -262,7 +262,7 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) { $articleTitleHtml = $doc->createDocumentFragment(); $articleTitleHtml->appendXML( $this->mapHtmlTagsForTitle( - $article->getCurrentPublication()->getLocalizedTitle( + $publication->getLocalizedTitle( $article->getData('locale'), 'html' ) @@ -270,7 +270,7 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) { ); $titleNode->appendChild($articleTitleHtml); - if (!empty($subtitle = $article->getCurrentPublication()->getLocalizedSubTitle($article->getData('locale'), 'html'))) { + if (!empty($subtitle = $publication->getLocalizedSubTitle($article->getData('locale'), 'html'))) { $subtitleHtml = $doc->createDocumentFragment(); $subtitleHtml->appendXML($this->mapHtmlTagsForTitle($subtitle)); @@ -280,7 +280,7 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) { $subtitleNode->appendChild($subtitleHtml); } - foreach ($article->getCurrentPublication()->getTitles('html') as $locale => $title) { + foreach ($publication->getTitles('html') as $locale => $title) { if ($locale == $article->getData('locale')) { continue; } @@ -297,7 +297,7 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) { $titleHtml->appendXML($title); $titleNode->appendChild($titleHtml); - if (!empty($subtitle = $article->getCurrentPublication()->getLocalizedSubTitle($locale, 'html'))) { + if (!empty($subtitle = $publication->getLocalizedSubTitle($locale, 'html'))) { $subtitleNode = $transTitleGroupNode->appendChild($doc->createElement('trans-subtitle')); $subtitleHtml = $doc->createDocumentFragment(); $subtitleHtml->appendXML($this->mapHtmlTagsForTitle($subtitle)); @@ -307,11 +307,12 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) { // Set the article keywords. $keywordGroupNode = $xpath->query('//article/front/article-meta/kwd-group')->item(0); + /** @var SubmissionKeywordDAO $submissionKeywordDao */ $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); while (($kwdGroupNodes = $articleMetaNode->getElementsByTagName('kwd-group'))->length !== 0) { $articleMetaNode->removeChild($kwdGroupNodes->item(0)); } - foreach ($submissionKeywordDao->getKeywords($publication->getId(), $journal->getSupportedLocales()) as $locale => $keywords) { + foreach ($submissionKeywordDao->getKeywords($publication->getId()) as $locale => $keywords) { if (empty($keywords)) continue; $kwdGroupNode = $this->_addChildInOrder($articleMetaNode, $doc->createElement('kwd-group'));