Skip to content

Commit

Permalink
pkp#322 Unable to submit review data with multilingual submission
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson committed Dec 6, 2024
1 parent fec1f1d commit 652af0e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions OrcidProfilePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,6 @@ public function buildOrcidReview($submission, $review, $request, $issue = null)

if (!empty($submission->getData('pub-id::doi'))) {
$externalIds = [

'external-id-type' => 'doi',
'external-id-value' => $submission->getData('pub-id::doi'),
'external-id-url' => [
Expand All @@ -1176,17 +1175,14 @@ public function buildOrcidReview($submission, $review, $request, $issue = null)

}

$translatedTitleAvailable = false;
foreach ($supportedSubmissionLocales as $defaultLanguage) {
if ($defaultLanguage !== $publicationLocale) {
$iso2LanguageCode = substr($defaultLanguage, 0, 2);
$defaultTitle = $submission->getLocalizedTitle($iso2LanguageCode);
if (strlen($defaultTitle) > 0 && !$translatedTitleAvailable) {
$orcidReview['subject-name']['translated-title'] = ['value' => $defaultTitle, 'language-code' => $iso2LanguageCode];
$translatedTitleAvailable = true;
}
$allTitles = $submission->getCurrentPublication()->getData('title');
$submissionLocale = $submission->getData('locale');
foreach ($allTitles as $locale => $title) {
if ($locale === $submissionLocale) {
$orcidReview['subject-name']['title'] = ['value' => $title];
} else {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => substr($locale, 0, 2)];
}

}
}
return $orcidReview;
Expand Down

0 comments on commit 652af0e

Please sign in to comment.