diff --git a/module/task/model.php b/module/task/model.php index f6d41ee5e9..c349c9d87d 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2689,13 +2689,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();