* Fix bug #25988.
This commit is contained in:
@@ -1847,9 +1847,12 @@ class storyModel extends model
|
||||
->where('product')->eq($oldStory->product)
|
||||
->andWhere('id')->in($oldStory->plan)
|
||||
->fetchPairs();
|
||||
if(!empty($oldStory->plan) and isset($branchPlanPairs[$plan->branch]) and $branchPlanPairs[$plan->branch] != $planID) $unlinkPlans[$branchPlanPairs[$plan->branch]] = empty($unlinkPlans[$branchPlanPairs[$plan->branch]]) ? $storyID : "{$unlinkPlans[$branchPlanPairs[$plan->branch]]},$storyID";
|
||||
if(isset($branchPlanPairs[$plan->branch])) $branchPlanPairs[$plan->branch] = $planID;
|
||||
|
||||
|
||||
$story->plan = $oldStory->plan ? ',' . implode(',', $branchPlanPairs) : ",$planID";
|
||||
if($story->plan != $oldStory->plan and !empty($story->plan)) $link2Plans[$planID] = empty($link2Plans[$planID]) ? $storyID : "{$link2Plans[$planID]},$storyID";
|
||||
}
|
||||
|
||||
/* Change stage. */
|
||||
@@ -1878,8 +1881,8 @@ class storyModel extends model
|
||||
if(!dao::isError())
|
||||
{
|
||||
$allChanges[$storyID] = common::createChanges($oldStory, $story);
|
||||
if($story->plan != $oldStory->plan and !empty($oldStory->plan)) $unlinkPlans[$oldStory->plan] = empty($unlinkPlans[$oldStory->plan]) ? $storyID : "{$unlinkPlans[$oldStory->plan]},$storyID";
|
||||
if($story->plan != $oldStory->plan and !empty($story->plan)) $link2Plans[$story->plan] = empty($link2Plans[$story->plan]) ? $storyID : "{$link2Plans[$story->plan]},$storyID";
|
||||
if($story->plan != $oldStory->plan and !empty($oldStory->plan) and strpos($story->plan, ',') === false) $unlinkPlans[$oldStory->plan] = empty($unlinkPlans[$oldStory->plan]) ? $storyID : "{$unlinkPlans[$oldStory->plan]},$storyID";
|
||||
if($story->plan != $oldStory->plan and !empty($story->plan) and strpos($story->plan, ',') === false) $link2Plans[$story->plan] = empty($link2Plans[$story->plan]) ? $storyID : "{$link2Plans[$story->plan]},$storyID";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user