diff --git a/module/story/model.php b/module/story/model.php index 5bd84e6165..2db0e40cbe 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -755,10 +755,6 @@ class storyModel extends model $story->reviewers = implode(',', $story->reviewer); } } - if($specChanged && $oldStory->type == 'requirement' && $story->status == 'active') - { - $this->triggerURChanged($storyID); - } $changes = common::createChanges($oldStory, $story); if(isset($story->relievedTwins)) @@ -1156,7 +1152,9 @@ class storyModel extends model if($story->result == 'pass' && $oldStory->type == 'requirement') { - $this->triggerURChanged($storyID); + /* 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'); @@ -1164,19 +1162,6 @@ class storyModel extends model return true; } - /** - * Update story relation URChanged. - * - * @param int $storyID - * @access public - * @return void - */ - public function triggerURChanged(int $storyID): void - { - $relations = $this->storyTao->getRelation($storyID, 'requirement'); - $this->dao->update(TABLE_STORY)->set('URChanged')->eq(1)->where('id')->in($relations)->exec(); - } - /** * Batch review stories. *