From a70c2d0fadf82513158cf040ac0912b97d42aaa2 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 25 Sep 2020 16:26:10 +0800 Subject: [PATCH] * Fix bug #3529. --- module/story/model.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index afacdafd08..8e0652123f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1383,17 +1383,14 @@ class storyModel extends model $story->plan = trim(str_replace(",$oldPlanID,", ',', ",$oldStory->plan,"), ','); if(empty($story->branch)) $story->plan .= ",$planID"; } - if($planID and $this->session->currentProductType != 'normal' and $oldStory->branch == 0) + if($planID and $this->session->currentProductType != 'normal' and $oldStory->branch == 0 and !isset($oldStoryStages[$storyID][$plan->branch])) { - if(!isset($oldStoryStages[$storyID][$plan->branch])) - { - $story->stage = 'planned'; - $newStoryStage = new stdclass(); - $newStoryStage->story = $storyID; - $newStoryStage->branch = $plan->branch; - $newStoryStage->stage = $story->stage; - $this->dao->insert(TABLE_STORYSTAGE)->data($newStoryStage)->autoCheck()->exec(); - } + $story->stage = 'planned'; + $newStoryStage = new stdclass(); + $newStoryStage->story = $storyID; + $newStoryStage->branch = $plan->branch; + $newStoryStage->stage = $story->stage; + $this->dao->insert(TABLE_STORYSTAGE)->data($newStoryStage)->autoCheck()->exec(); } $this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();