From 182fb97787586c81f426e7e1e856be89196e7a7f Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Tue, 17 Dec 2024 12:59:27 +0100 Subject: [PATCH] pkp/pkp-lib#10726 consider all existing submission metadata langauges --- plugins/importexport/doaj/filter/DOAJXmlFilter.php | 3 +-- plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php | 5 ++--- .../rfc1807/OAIMetadataFormat_RFC1807.php | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/plugins/importexport/doaj/filter/DOAJXmlFilter.php b/plugins/importexport/doaj/filter/DOAJXmlFilter.php index d5817b9f28f..460bb5e9bac 100644 --- a/plugins/importexport/doaj/filter/DOAJXmlFilter.php +++ b/plugins/importexport/doaj/filter/DOAJXmlFilter.php @@ -190,10 +190,9 @@ public function &process(&$pubObjects) $recordNode->appendChild($node = $doc->createElement('fullTextUrl', htmlspecialchars($request->getDispatcher()->url($request, Application::ROUTE_PAGE, null, 'article', 'view', [$pubObject->getId()], urlLocaleForPage: ''), ENT_COMPAT, 'UTF-8'))); $node->setAttribute('format', 'html'); // Keywords - $supportedLocales = $context->getSupportedFormLocales(); /** @var SubmissionKeywordDAO */ $dao = DAORegistry::getDAO('SubmissionKeywordDAO'); - $articleKeywords = $dao->getKeywords($publication->getId(), $supportedLocales); + $articleKeywords = $dao->getKeywords($publication->getId()); if (array_key_exists($publication->getData('locale'), $articleKeywords)) { $keywordsInArticleLocale = $articleKeywords[$publication->getData('locale')]; unset($articleKeywords[$publication->getData('locale')]); diff --git a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php index dc8aa4d1758..d9a17f58837 100644 --- a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php +++ b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php @@ -92,10 +92,9 @@ public function &extractMetadataFromDataObject(&$article) // Subject $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); /** @var SubmissionKeywordDAO $submissionKeywordDao */ $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); /** @var SubmissionSubjectDAO $submissionSubjectDao */ - $supportedLocales = $journal->getSupportedFormLocales(); $subjects = array_merge_recursive( - (array) $submissionKeywordDao->getKeywords($publication->getId(), $supportedLocales), - (array) $submissionSubjectDao->getSubjects($publication->getId(), $supportedLocales) + (array) $submissionKeywordDao->getKeywords($publication->getId()), + (array) $submissionSubjectDao->getSubjects($publication->getId()) ); $this->_addLocalizedElements($dc11Description, 'dc:subject', $subjects); diff --git a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php index fd405c7de64..cff12db5d9d 100644 --- a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php +++ b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php @@ -77,8 +77,6 @@ public function toXml($record, $format = null) $creators[] = $authorName; } - $supportedLocales = $journal->getSupportedFormLocales(); - /** @var SubmissionKeywordDAO $submissionKeywordDao */ $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); @@ -86,8 +84,8 @@ public function toXml($record, $format = null) $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); $subjects = array_merge_recursive( - (array) $submissionKeywordDao->getKeywords($publication->getId(), $supportedLocales), - (array) $submissionSubjectDao->getSubjects($publication->getId(), $supportedLocales) + (array) $submissionKeywordDao->getKeywords($publication->getId()), + (array) $submissionSubjectDao->getSubjects($publication->getId()) ); $subject = $subjects[$journal->getPrimaryLocale()] ?? '';