Skip to content

Commit

Permalink
pkp/pkp-lib#10759 Store ORCID's review work put code in
Browse files Browse the repository at this point in the history
review_assignment table
  • Loading branch information
taslangraham committed Jan 7, 2025
1 parent 33a6d86 commit ba50c6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions dbscripts/xml/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<migration class="PKP\migration\install\CategoriesMigration" />
<migration class="PKP\migration\install\HighlightsMigration" />
<migration class="APP\migration\install\MetricsMigration" />
<migration class="PKP\migration\install\ReviewAssignmentSettings" />

<!-- Other install tasks -->
<code function="createData"/>
Expand Down
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
<migration class="PKP\migration\upgrade\v3_5_0\I10292_RemoveControlledVocabEntrySettingType"/>
<migration class="PKP\migration\upgrade\v3_5_0\I10292_UpdateControlledVocabAssocId"/>
<migration class="PKP\migration\upgrade\v3_5_0\I10292_UpdateControlledVocabEntrySettingName"/>
<migration class="PKP\migration\upgrade\v3_5_0\I10759_AddReviewAssignmentSettings"/>
</upgrade>

<!-- update plugin configuration - should be done as the final upgrade task -->
Expand Down
8 changes: 4 additions & 4 deletions jobs/orcid/DepositOrcidReview.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function handle(): void

$uri = OrcidManager::getApiPath($context) . OrcidManager::ORCID_API_VERSION_URL . $orcid . '/' . OrcidManager::ORCID_REVIEW_URL;
$method = 'POST';
if ($putCode = $reviewer->getData('orcidReviewPutCode')) {
if ($putCode = $reviewAssignment->getData('orcidReviewPutCode')) {
$uri .= '/' . $putCode;
$method = 'PUT';
$orcidReview['put-code'] = $putCode;
Expand Down Expand Up @@ -101,11 +101,11 @@ public function handle(): void
OrcidManager::logInfo("Review updated in profile, putCode: {$putCode}");
break;
case 201:
$location = $responseHeaders['Location'][0];
$location = $responseHeaders['location'][0];
// Extract the ORCID work put code for updates/deletion.
$putCode = basename(parse_url($location, PHP_URL_PATH));
$reviewer->setData('orcidReviewPutCode', $putCode);
Repo::user()->edit($reviewer, ['orcidReviewPutCode']);
$reviewAssignment->setData('orcidReviewPutCode', $putCode);
Repo::reviewAssignment()->edit($reviewAssignment, ['orcidReviewPutCode']);
OrcidManager::logInfo("Review added to profile, putCode: {$putCode}");
break;
default:
Expand Down

0 comments on commit ba50c6a

Please sign in to comment.