Skip to content

Commit

Permalink
pkp/orcidProfile#322 Unable to submit review data with multilingual s…
Browse files Browse the repository at this point in the history
…ubmission
  • Loading branch information
ewhanson committed Dec 19, 2024
1 parent 235f45e commit f15a072
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions classes/orcid/OrcidReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ private function build(): array
$orcidReview['subject-url'] = ['value' => $publicationUrl];
$orcidReview['review-url'] = ['value' => $publicationUrl];
$orcidReview['subject-type'] = 'journal-article';
$orcidReview['subject-name'] = [
'title' => ['value' => $this->submission->getCurrentPublication()->getLocalizedTitle($submissionLocale) ?? '']
];

$allTitles = $currentPublication->getData('title');
foreach ($allTitles as $locale => $title) {
if ($locale === $submissionLocale) {
$orcidReview['subject-name']['title'] = ['value' => $title];
} else {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => LocaleConversion::getIso1FromLocale($locale)];
}
}

if (!empty($currentPublication->getDoi())) {
/** @var Doi $doiObject */
Expand All @@ -122,15 +128,6 @@ private function build(): array
}
}

$allTitles = $currentPublication->getData('title');
foreach ($allTitles as $locale => $title) {
if ($locale !== $submissionLocale) {
$iso1Locale = LocaleConversion::getIso1FromLocale($locale);
if ($iso1Locale) {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => $iso1Locale];
}
}
}

return $orcidReview;
}
Expand Down

0 comments on commit f15a072

Please sign in to comment.