From 8480361adb8536ccb187186e561ab1ebc351d8a8 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 28 Oct 2020 10:20:35 +0800 Subject: [PATCH] * Finish task #12964. --- module/task/model.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 311d17afd6..abb74d7a78 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2771,13 +2771,10 @@ class taskModel extends model */ public function processData4Report($tasks, $children, $field) { - if($children) + if(is_array($children)) { - foreach($children as $taskID => $task) - { - $tasks[$taskID] = $task; - unset($tasks[$task->parent]); - } + /* Remove the parent task from the tasks. */ + foreach($children as $childTaskID => $childTask) unset($tasks[$childTask->parent]); } $fields = array();