Skip to content

Commit

Permalink
Merge pull request #4355 from jonasraoni/feature-stable-3_3_0-10174-i…
Browse files Browse the repository at this point in the history
…nclude-orcid-on-pubmed

pkp/pkp-lib#10174 Included ORCID ID
  • Loading branch information
jonasraoni authored Jul 16, 2024
2 parents d7ad655 + bd23b1a commit 821d8e6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ function generateAuthorNode($doc, $journal, $issue, $submission, $author) {
$authorElement->appendChild($doc->createElement('LastName'))->appendChild($doc->createTextNode(ucfirst($author->getLocalizedFamilyName())));
}
$authorElement->appendChild($doc->createElement('Affiliation'))->appendChild($doc->createTextNode($author->getLocalizedAffiliation()));
// We're storing the ORCID with a URL (http://orcid.org/{$ID}), but the XML expects just the ID
$orcidId = explode('/', trim($author->getData('orcid') ?? '', '/'));
$orcidId = array_pop($orcidId);
if ($orcidId) {
$orcidNode = $authorElement->appendChild($doc->createElement('Identifier'));
$orcidNode->setAttribute('Source', 'ORCID');
$orcidNode->appendChild($doc->createTextNode($orcidId));
}

return $authorElement;
}
Expand Down

0 comments on commit 821d8e6

Please sign in to comment.