Skip to content

Commit

Permalink
fix: support empty subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
withanage committed May 3, 2020
1 parent e91772f commit 5ee8bde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions OrcidProfilePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ public function buildOrcidWork($publication, $context, $authors, $request, $issu
$bibtexCitation = trim(strip_tags($citationPlugin->getCitation($request, $submission, 'bibtex', $issue, $publication)));

$publicationLocale = $publication->getData('locale');
$titles = $publication->getData('title', $publicationLocale);

$publicationUrl = $request->getDispatcher()->url($request, ROUTE_PAGE, null, 'article', 'view', $publication->getId());

$orcidWork = [
Expand All @@ -991,7 +991,7 @@ public function buildOrcidWork($publication, $context, $authors, $request, $issu
'value' => $publication->getLocalizedData('title', $publicationLocale)
],
'subtitle' => [
'value' => $publication->getLocalizedData('subtitle', $publicationLocale)
'value' => $publication->getLocalizedData('subtitle', $publicationLocale) ?? ''
]
],
'journal-title' => [
Expand Down Expand Up @@ -1155,7 +1155,7 @@ private function buildOrcidContributors($authors, $contextId) {
$orcid = basename(parse_url($author->getOrcid(), PHP_URL_PATH));

if ($author->getData('orcidSandbox')) {
$uri = 'https://sandbox.orcid.org/' . $orcid;
$uri = ORCID_URL_SANDBOX . $orcid;
$host = 'sandbox.orcid.org';
} else {
$uri = $author->getOrcid();
Expand Down
2 changes: 1 addition & 1 deletion pages/OrcidHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function orcidVerify($args, $request) {
$plugin->getSetting($contextId, 'orcidProfileAPIPath') == ORCID_API_URL_PUBLIC_SANDBOX) {
// Set a flag to mark that the stored orcid id and access token came form the sandbox api
$authorToVerify->setData('orcidSandbox', true);
$templateMgr->assign('orcid', 'https://sandbox.orcid.org/' . $response['orcid']);
$templateMgr->assign('orcid', ORCID_URL_SANDBOX . $response['orcid']);
} else {
$templateMgr->assign('orcid', $orcidUri);
}
Expand Down

0 comments on commit 5ee8bde

Please sign in to comment.