From 4b1db85fe04edb469f6fb751c1acf4d77e1b86ae Mon Sep 17 00:00:00 2001 From: mrozniecki Date: Fri, 19 Jul 2024 14:58:22 +0200 Subject: [PATCH] Fix line_order when we have children with children and backport a fix from develop for getChildrenOfLine with includealltree set --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 398a2d677318a..c84aadc4cd5e8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3077,7 +3077,7 @@ public function line_order($renum = false, $rowidorder = 'ASC', $fk_parent_line while ($i < $num) { $row = $this->db->fetch_row($resql); $rows[] = $row[0]; // Add parent line into array rows - $childrens = $this->getChildrenOfLine($row[0]); + $childrens = $this->getChildrenOfLine($row[0], 1); if (!empty($childrens)) { foreach ($childrens as $child) { array_push($rows, $child); @@ -3127,7 +3127,7 @@ public function getChildrenOfLine($id, $includealltree = 0) while ($row = $this->db->fetch_row($resql)) { $rows[] = $row[0]; if (!empty($includealltree)) { - $rows = array_merge($rows, $this->getChildrenOfLine($row[0]), $includealltree); + $rows = array_merge($rows, $this->getChildrenOfLine($row[0], $includealltree)); } } }