Skip to content

Commit

Permalink
pkp/pkp-lib#7528 Crossref export: use given name in submission locale…
Browse files Browse the repository at this point in the history
… if family name does not exist
  • Loading branch information
bozana committed Aug 24, 2022
1 parent ca8e2c7 commit e36340a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function createPostedContentNode($doc, $publication, $submission) {
$givenNames = $author->getGivenName(null);

// Check if both givenName and familyName is set for the submission language.
if (isset($familyNames[$locale]) && isset($givenNames[$locale])) {
if (!empty($familyNames[$locale]) && !empty($givenNames[$locale])) {
$personNameNode->setAttribute('language', PKPLocale::getIso1FromLocale($locale));
$personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'given_name', htmlspecialchars(ucfirst($givenNames[$locale]), ENT_COMPAT, 'UTF-8')));
$personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($familyNames[$locale]), ENT_COMPAT, 'UTF-8')));
Expand Down Expand Up @@ -187,7 +187,7 @@ function createPostedContentNode($doc, $publication, $submission) {
}

} else {
$personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($author->getFullName(false)), ENT_COMPAT, 'UTF-8')));
$personNameNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($givenNames[$locale]), ENT_COMPAT, 'UTF-8')));
}

if ($author->getData('orcid')) {
Expand Down

0 comments on commit e36340a

Please sign in to comment.