From 1e55cccbfb74e0ad71b2801ed0f412d5f5ef5419 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Sat, 4 Feb 2023 14:52:04 +0600 Subject: [PATCH] pkp/pkp-lib#7486 Updated thank you considered status modification logic --- .../grid/users/reviewer/form/ThankReviewerForm.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/controllers/grid/users/reviewer/form/ThankReviewerForm.php b/controllers/grid/users/reviewer/form/ThankReviewerForm.php index 81ef8c994ab..ff7cd030647 100644 --- a/controllers/grid/users/reviewer/form/ThankReviewerForm.php +++ b/controllers/grid/users/reviewer/form/ThankReviewerForm.php @@ -149,11 +149,13 @@ public function execute(...$functionArgs) $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /** @var ReviewAssignmentDAO $reviewAssignmentDao */ $reviewAssignment->setDateAcknowledged(Core::getCurrentDate()); $reviewAssignment->stampModified(); - $reviewAssignment->setConsidered( - $reviewAssignment->getConsidered() === ReviewAssignment::REVIEW_ASSIGNMENT_NEW - ? ReviewAssignment::REVIEW_ASSIGNMENT_CONSIDERED - : ReviewAssignment::REVIEW_ASSIGNMENT_RECONSIDERED - ); + if(!in_array($reviewAssignment->getConsidered(), [ReviewAssignment::REVIEW_ASSIGNMENT_CONSIDERED, ReviewAssignment::REVIEW_ASSIGNMENT_RECONSIDERED])) { + $reviewAssignment->setConsidered( + $reviewAssignment->getConsidered() === ReviewAssignment::REVIEW_ASSIGNMENT_NEW + ? ReviewAssignment::REVIEW_ASSIGNMENT_CONSIDERED + : ReviewAssignment::REVIEW_ASSIGNMENT_RECONSIDERED + ); + } $reviewAssignmentDao->updateObject($reviewAssignment); parent::execute(...$functionArgs);