From 0e0aed22f13149042b9bdeb696e5f6964af3bce3 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 19 May 2022 03:26:18 +0000 Subject: [PATCH] * Fix bug #22639. --- module/productplan/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index daa6fbce6f..e7ddf6f878 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -497,6 +497,7 @@ class productplanModel extends model $plan = fixer::input('post')->stripTags($this->config->productplan->editor->edit['id'], $this->config->allowedTags) ->setIF($this->post->future or empty($_POST['begin']), 'begin', $this->config->productplan->future) ->setIF($this->post->future or empty($_POST['end']), 'end', $this->config->productplan->future) + ->setIF(!isset($_POST['parent']), 'parent', -1) ->add('id', $planID) ->remove('delta,uid,future') ->get(); @@ -515,9 +516,9 @@ class productplanModel extends model if($plan->end !== $this->config->productplan->future and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end); } } - elseif($parentPlan and $plan->begin != $this->config->productplan->future) + elseif($plan->parent == -1 and $plan->begin != $this->config->productplan->future) { - $childPlans = $this->getChildren($parentPlan->id); + $childPlans = $this->getChildren($oldPlan->id); $minBegin = $plan->begin; $maxEnd = $plan->end; foreach($childPlans as $childID => $childPlan)