Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#9533 Adds decisions constants migration for OPS 3.4.0 #597

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions classes/migration/upgrade/v3_4_0/I7725_DecisionConstantsUpdate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/**
* @file classes/migration/upgrade/v3_4_0/I7725_DecisionConstantsUpdate.php
*
* Copyright (c) 2014-2022 Simon Fraser University
* Copyright (c) 2000-2022 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class I7725_DecisionConstantsUpdate
* @brief Editorial decision constant sync up accross all application
*
* @see https://github.com/pkp/pkp-lib/issues/7725
*/

namespace APP\migration\upgrade\v3_4_0;

class I7725_DecisionConstantsUpdate extends \PKP\migration\upgrade\v3_4_0\I7725_DecisionConstantsUpdate
{
/**
* Get the decisions constants mappings
*
*/
public function getDecisionMappings(): array
{
return [
// \PKP\decision\Decision::INITIAL_DECLINE
[
'stage_id' => [WORKFLOW_STAGE_ID_PRODUCTION],
'current_value' => 9,
'updated_value' => 8,
],

// \PKP\decision\Decision::REVERT_INITIAL_DECLINE
[
'stage_id' => [WORKFLOW_STAGE_ID_PRODUCTION],
'current_value' => 17,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the \PKP\decision\Decision::REVERT_INITIAL_DECLINE, the current_value should be 18 . the changes can be compared at https://github.com/pkp/pkp-lib/pull/8218/files#diff-62bb1ef0ef526750d90461c6e3f7538f6da0f85260a6575f8b02fe44f3d763aeL38-R45 .

Copy link
Contributor Author

@JhonathanLepidus JhonathanLepidus Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In OPS 3.3.0, when declining a submission, it generates a decision with INITIAL_DECLINE value. However, when reversing this declining, it creates a decision with REVERT_DECLINE value, instead of REVERT_INITIAL_DECLINE.

Declinings and reversals in 3.3.0:

declining_and_reverting

In OPS 3.4.0, the declining is also the INITIAL_DECLINE, but the reversing is a REVERT_INITIAL_DECLINE (what is more semantically correct).

Declinings and reversals in 3.4.0:

declining_and_reversing_340

This is the reason why we migrate the value from REVERT_DECLINE (17) in 3.3.0 to REVERT_INITIAL_DECLINE (16) in 3.4.0.

'updated_value' => 16
],


];
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<migration class="PKP\migration\upgrade\v3_4_0\I8151_ExtendSettingValues"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7366_UpdateUserAPIKeySettings"/>
<migration class="PKP\migration\upgrade\v3_4_0\I8093_UpdateUserGroupRelationTablesFK"/>
<migration class="APP\migration\upgrade\v3_4_0\I7725_DecisionConstantsUpdate"/>
<migration class="APP\migration\upgrade\v3_4_0\I7796_UpdateCrossrefSchema"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7287_RemoveEmailTemplatesDefault"/>
<migration class="PKP\migration\upgrade\v3_4_0\I7874_NotificationMetadataModifiedRemove"/>
Expand Down