Skip to content

Commit

Permalink
ORCID fix: provide no element if the locale is not in ISO 639-1, fix …
Browse files Browse the repository at this point in the history
…localized publication title
  • Loading branch information
bozana committed Dec 11, 2024
1 parent 3c4bcbf commit d4f1460
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/orcid/OrcidReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private function build(): array
$orcidReview['review-url'] = ['value' => $publicationUrl];
$orcidReview['subject-type'] = 'journal-article';
$orcidReview['subject-name'] = [
'title' => ['value' => $this->submission->getCurrentPublication()->getLocalizedData('title') ?? '']
'title' => ['value' => $this->submission->getCurrentPublication()->getLocalizedTitle($submissionLocale) ?? '']
];

if (!empty($currentPublication->getDoi())) {
Expand All @@ -125,7 +125,10 @@ private function build(): array
$allTitles = $currentPublication->getData('title');
foreach ($allTitles as $locale => $title) {
if ($locale !== $submissionLocale) {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => LocaleConversion::getIso1FromLocale($locale)];
$iso1Locale = LocaleConversion::getIso1FromLocale($locale);
if ($iso1Locale) {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => $iso1Locale];
}
}
}

Expand Down

0 comments on commit d4f1460

Please sign in to comment.