From bc4ca51f4899d90cb0590e09e68f19071fd57513 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 28 Aug 2023 11:22:43 +0800 Subject: [PATCH] * Fix batch create child task error. --- module/task/control.php | 2 +- module/task/model.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 5b0e3a231e..9f58cebea9 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -145,7 +145,7 @@ class task extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); /* Update other data related to the task after it is created. */ - $this->task->afterBatchCreate($taskIdList); + $this->task->afterBatchCreate($taskIdList, $taskID); if(!isset($output['laneID']) || !isset($output['columnID'])) $this->loadModel('kanban')->updateLane($executionID, 'task'); $response = $this->taskZen->responseAfterbatchCreate($taskIdList, $execution); diff --git a/module/task/model.php b/module/task/model.php index fc0430e8ce..16d6282b33 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -105,11 +105,10 @@ class taskModel extends model public function afterBatchCreate(array $taskIdList, int $parentID = 0): bool { /* Process other data after split task. */ - if($parentID && empty($taskIdList)) + if($parentID && !empty($taskIdList)) { - $childrenIdList = !empty($parentID) ? $taskIdList : array(); - $parentTask = $this->getByID($parentID); - $this->afterSplitTask($parentTask, $childrenIdList); + $parentTask = $this->taskTao->fetchByID($parentID); + $this->afterSplitTask($parentTask, $taskIdList); } return !dao::isError();