From 87fca00a07b914c9c3388dca9cef494e2c5e5689 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 10 Jan 2024 01:46:48 +0000 Subject: [PATCH] * Fix bug #42185. --- module/story/model.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index a15a7aa938..68710202e1 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -645,8 +645,9 @@ class storyModel extends model ->where('id')->eq($storyID)->exec(); if(dao::isError()) return false; - $specChanged = $oldStory->version != $story->version; $this->loadModel('file')->updateObjectID($this->post->uid, $storyID, 'story'); + + $specChanged = $oldStory->version != $story->version; if($specChanged) { $addedFiles = $this->file->saveUpload($oldStory->type, $storyID, $story->version); @@ -675,12 +676,6 @@ class storyModel extends model $this->dao->update(TABLE_STORY)->set('URChanged')->eq(0)->where('id')->eq($oldStory->id)->exec(); $this->updateStoryVersion($newStory); } - else - { - /* IF is requirement changed, notify its relation. */ - $relations = $this->storyTao->getRelation($storyID, 'requirement'); - $this->dao->update(TABLE_STORY)->set('URChanged')->eq(1)->where('id')->in($relations)->exec(); - } if($story->reviewerHasChanged) { @@ -1080,6 +1075,13 @@ class storyModel extends model if($actionID) $this->action->logHistory($actionID, $changes); } + if($story->result == 'pass' && $oldStory->type == 'requirement') + { + /* IF is requirement changed, notify its relation. */ + $relations = $this->storyTao->getRelation($storyID, 'requirement'); + $this->dao->update(TABLE_STORY)->set('URChanged')->eq(1)->where('id')->in($relations)->exec(); + } + if(!empty($oldStory->twins)) $this->syncTwins($oldStory->id, $oldStory->twins, $changes, 'Reviewed'); return true;