Skip to content

Commit

Permalink
Merge pull request #4618 from kaitlinnewson/10796-main
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson authored Jan 23, 2025
2 parents c91ba85 + bd7de15 commit 0857a4f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion plugins/generic/datacite/filter/DataciteXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function createCreatorsNode(DOMDocument $doc, Issue $issue, Publication $
foreach ($authors as $author) { /** @var Author $author */
$creators[] = [
'name' => $author->getFullName(false, true, $publication->getData('locale')),
'orcid' => $author->getOrcid(),
'orcid' => $author->getData('orcidIsVerified') ? $author->getData('orcid') : null,
'affiliation' => $author->getLocalizedData('affiliation', $publication->getData('locale')),
'ror' => $author->getData('rorId') ?? null
];
Expand Down
4 changes: 2 additions & 2 deletions plugins/importexport/doaj/filter/DOAJJsonFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ public function &process(&$pubObject)
if (!empty($affiliation)) {
$author['affiliation'] = $affiliation;
}
if ($orcid = $articleAuthor->getData('orcid')) {
$author['orcid_id'] = $orcid;
if ($articleAuthor->getData('orcid') && $articleAuthor->getData('orcidIsVerified')) {
$author['orcid_id'] = $articleAuthor->getData('orcid');
}
$article['bibjson']['author'][] = $author;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/importexport/doaj/filter/DOAJXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ public function createAuthorNode($doc, $publication, $author, $affilList)
if (in_array($author->getAffiliation($publication->getData('locale')), $affilList) && !empty($affilList[0])) {
$authorNode->appendChild($node = $doc->createElement('affiliationId', htmlspecialchars(current(array_keys($affilList, $author->getAffiliation($publication->getData('locale')))), ENT_COMPAT, 'UTF-8')));
}
if ($orcid = $author->getData('orcid')) {
$authorNode->appendChild($doc->createElement('orcid_id'))->appendChild($doc->createTextNode($orcid));
if ($author->getData('orcid') && $author->getData('orcidIsVerified')) {
$authorNode->appendChild($doc->createElement('orcid_id'))->appendChild($doc->createTextNode($author->getData('orcid')));
}
return $authorNode;
}
Expand Down
17 changes: 10 additions & 7 deletions plugins/importexport/pubmed/filter/ArticlePubMedXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,16 @@ public 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));

if ($author->getData('orcid') && $author->getData('orcidIsVerified')) {
// 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
2 changes: 1 addition & 1 deletion plugins/oaiMetadataFormats/marc/templates/record.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{assign var=affiliation value=$author->getAffiliation($journal->getPrimaryLocale())}
{if $affiliation}<subfield label="u">{$affiliation|escape}</subfield>{/if}
{if $author->getUrl()}<subfield label="0">{$author->getUrl()|escape}</subfield>{/if}
{if $author->getData('orcid')}<subfield label="0">{$author->getData('orcid')|escape}</subfield>{/if}
{if $author->getData('orcid') && $author->getData('orcidIsVerified')}<subfield label="0">{$author->getData('orcid')|escape}</subfield>{/if}
</varfield>
{/foreach}
{if $subject}<varfield id="653" i1=" " i2=" ">
Expand Down
2 changes: 1 addition & 1 deletion plugins/oaiMetadataFormats/marcxml/templates/record.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{assign var=affiliation value=$author->getAffiliation($journal->getPrimaryLocale())}
{if $affiliation}<subfield code="u">{$affiliation|escape}</subfield>{/if}
{if $author->getUrl()}<subfield code="0">{$author->getUrl()|escape}</subfield>{/if}
{if $author->getData('orcid')}<subfield code="0">{$author->getData('orcid')|escape}</subfield>{/if}
{if $author->getData('orcid') && $author->getData('orcidIsVerified')}<subfield code="0">{$author->getData('orcid')|escape}</subfield>{/if}
</datafield>
{/foreach}
{if $subject}<datafield tag="653" ind1=" " ind2=" ">
Expand Down

0 comments on commit 0857a4f

Please sign in to comment.