Skip to content

Commit

Permalink
Optimize the code for accessing ORCID and organization id in JSON+LD
Browse files Browse the repository at this point in the history
  • Loading branch information
kuang5 authored and dbenham committed Sep 11, 2024
1 parent bfbaaf8 commit 14aae8d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/plugins/publications/jsonld/jsonld.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ public function onPublication($publication, $option, $areas, $rtrn='all', $versi

$givenName = $contributor->givenName;
$familyName = $contributor->surname;
$orcid = $contributor->orcid;
$orgid = $contributor->orgid;

if (!$givenName)
{
Expand Down Expand Up @@ -139,9 +137,9 @@ public function onPublication($publication, $option, $areas, $rtrn='all', $versi
'familyName' => $familyName
);

if ($orcid)
if ($contributor->orcid)
{
$author['@id'] = "https://orcid.org/" . $orcid;
$author['@id'] = "https://orcid.org/" . $contributor->orcid;
}

if ($contributor->organization)
Expand All @@ -151,9 +149,9 @@ public function onPublication($publication, $option, $areas, $rtrn='all', $versi
'name' => $contributor->organization
);

if ($orgid)
if ($contributor->orgid)
{
$org['@id'] = $orgid;
$org['@id'] = $contributor->orgid;
}

$author['affiliation'] = $org;
Expand Down

0 comments on commit 14aae8d

Please sign in to comment.