Skip to content

Commit

Permalink
pkp/pkp-lib#10726 consider all existing submission metadata langauges
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Dec 17, 2024
1 parent be251ea commit 182fb97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions plugins/importexport/doaj/filter/DOAJXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')]);
Expand Down
5 changes: 2 additions & 3 deletions plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,15 @@ public function toXml($record, $format = null)
$creators[] = $authorName;
}

$supportedLocales = $journal->getSupportedFormLocales();

/** @var SubmissionKeywordDAO $submissionKeywordDao */
$submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO');

/** @var SubmissionSubjectDAO $submissionSubjectDao */
$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()] ?? '';

Expand Down

0 comments on commit 182fb97

Please sign in to comment.