[TGDK][Fix] Ensure articles transition to 'Accepted' stage when review is the final workflow step #4552
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.
Important
This implementation is part of a set of features and fixes developed within the context of a project for the TGDK academic journal, with the goal of customizing Janeway to meet the journal's specific needs, which may also be extended to other contexts.
Problem / Objective
When the
draft_decisions
option is enabled and the editorial workflow is limited to the review stage, accepting a draft decision that approves an article should transition its stage toAccepted
. However, it incorrectly transitions toEditor Copyediting
.This issue becomes particularly problematic when the workflow is restricted to the review stage, as articles appear in the
Copyediting
stage instead of being marked asAccepted
. This discrepancy leads to logistical issues within the platform.Solution
The problem was identified in the
manage_draft
function, where the stage is directly set toSTAGE_EDITOR_COPYEDITING
:The fix ensures that the initial stage after approval is set to
STAGE_ACCEPTED
. If subsequent workflow stages exist (e.g., Copyediting), the article will transition to those automatically, but the primary stage must always begin asAccepted
.