-
Notifications
You must be signed in to change notification settings - Fork 48
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
JhonathanLepidus
wants to merge
1
commit into
pkp:stable-3_4_0
from
lepidus:i9533-fixDecisionsMigration
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
classes/migration/upgrade/v3_4_0/I7725_DecisionConstantsUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
'updated_value' => 16 | ||
], | ||
|
||
|
||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
, thecurrent_value
should be18
. the changes can be compared at https://github.com/pkp/pkp-lib/pull/8218/files#diff-62bb1ef0ef526750d90461c6e3f7538f6da0f85260a6575f8b02fe44f3d763aeL38-R45 .There was a problem hiding this comment.
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 withREVERT_DECLINE
value, instead ofREVERT_INITIAL_DECLINE
.Declinings and reversals in 3.3.0:
In OPS 3.4.0, the declining is also the
INITIAL_DECLINE
, but the reversing is aREVERT_INITIAL_DECLINE
(what is more semantically correct).Declinings and reversals in 3.4.0:
This is the reason why we migrate the value from
REVERT_DECLINE
(17) in 3.3.0 toREVERT_INITIAL_DECLINE
(16) in 3.4.0.