From a627dd9ae804daaf593107175ee601b315866250 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 May 2014 17:14:40 +0200 Subject: [PATCH] Fix: Duplicate line when project has no tasks. --- htdocs/core/class/html.formother.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 472a1c19668..7f30f7c9c96 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -479,11 +479,11 @@ class FormOther $numlines=count($lines); for ($i = 0 ; $i < $numlines ; $i++) { - if ($lines[$i]->fk_parent == $parent) + if ($lines[$i]->fk_parent == $parent) { $var = !$var; - //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); + //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines // Break on a new project if ($parent == 0) // We are on a task at first level @@ -514,7 +514,7 @@ class FormOther $newdisablechildoftaskid=$disablechildoftaskid; // Print task - if ($lines[$i]->id >= 0) + if (isset($lines[$i]->id)) // We use isset because $lines[$i]->id may be null if project has no task and are on root project (tasks may be caught by a left join). We enter here only if '0' or >0 { // Check if we must disable entry $disabled=0;