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 ab2d018 commit 7cf0037
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions OAIMetadataFormat_JATS.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) {
$articleTitleHtml = $doc->createDocumentFragment();
$articleTitleHtml->appendXML(
$this->mapHtmlTagsForTitle(
$article->getCurrentPublication()->getLocalizedTitle(
$publication->getLocalizedTitle(
$article->getData('locale'),
'html'
)
)
);
$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));
Expand All @@ -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;
}
Expand All @@ -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));
Expand All @@ -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'));
Expand Down

0 comments on commit 7cf0037

Please sign in to comment.