diff --git a/module/story/model.php b/module/story/model.php index 054fa4f2da..5d98009f0b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1771,18 +1771,18 @@ class storyModel extends model $allChanges[$storyID] = common::createChanges($oldStory, $story); if($story->plan != $oldStory->plan and !empty($oldStory->plan) and $oldStory->type == 'story') { - foreach(explode(',', (string)$oldStory->plan) as $planID) + foreach(explode(',', (string)$oldStory->plan) as $oldPlanID) { - if(!$planID) continue; - $unlinkPlans[$planID] = empty($unlinkPlans[$planID]) ? $storyID : "{$unlinkPlans[$planID]},$storyID"; + if(!$oldPlanID) continue; + $unlinkPlans[$oldPlanID] = empty($unlinkPlans[$oldPlanID]) ? $storyID : "{$unlinkPlans[$oldPlanID]},$storyID"; } } if($story->plan != $oldStory->plan and !empty($story->plan)) { - foreach(explode(',', (string)$story->plan) as $planID) + foreach(explode(',', (string)$story->plan) as $newPlanID) { - if(!$planID) continue; - $link2Plans[$planID] = empty($link2Plans[$planID]) ? $storyID : "{$link2Plans[$planID]},$storyID"; + if(!$newPlanID) continue; + $link2Plans[$newPlanID] = empty($link2Plans[$newPlanID]) ? $storyID : "{$link2Plans[$newPlanID]},$storyID"; } } }