Skip to content

Commit

Permalink
#35 Use publication seq for article sequence information (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson authored Oct 19, 2023
1 parent 6881372 commit 7638b68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions OAIMetadataFormat_JATS.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,10 @@ protected function _mungeMetadata($doc, $journal, $article, $section, $issue) {
'issueIds' => [$issue->getId()],
'status' => STATUS_PUBLISHED,
]));
$articleIds = array_map(function($publishedArticle) {
return $publishedArticle->getId();
}, $publishedArticles);
foreach (['volume', 'issue'] as $nodeName) {
$match = $xpath->query("//article/front/article-meta/$nodeName");
if ($match->length) {
$match->item(0)->setAttribute('seq', array_search($article->getId(), $articleIds)+1);
$match->item(0)->setAttribute('seq', ((int) $publication->getData('seq')) + 1);
break;
}
}
Expand Down

0 comments on commit 7638b68

Please sign in to comment.