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();