From cd7de255bc990bb307da206bc8702dbc8bbdc1c9 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Fri, 5 Sep 2025 14:03:42 +0200 Subject: [PATCH] Fix CI --- htdocs/bom/class/bom.class.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 48102956bac..2cf64b08ef1 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1592,14 +1592,13 @@ class BOM extends CommonObject /** * Recursively retrieves all parent bom in the tree that leads to the $bom_id bom * - * @param BOM[] $TParentBom We put all found parent bom in $TParentBom + * @param int[] $TParentBom We put all found parent bom in $TParentBom * @param int $bom_id ID of bom from which we want to get parent bom ids * @param int<0,1000> $level Protection against infinite loop * @return void */ public function getParentBomTreeRecursive(&$TParentBom, $bom_id = 0, $level = 1) { - // Protection against infinite loop if ($level > 1000) { return; @@ -1609,15 +1608,13 @@ class BOM extends CommonObject $bom_id = $this->id; } - $sql = 'SELECT l.fk_bom, b.label - FROM '.MAIN_DB_PREFIX.'bom_bomline l - INNER JOIN '.MAIN_DB_PREFIX.$this->table_element.' b ON b.rowid = l.fk_bom - WHERE fk_bom_child = '.((int) $bom_id); + $sql = "SELECT l.fk_bom, b.label FROM ".MAIN_DB_PREFIX."bom_bomline as l INNER JOIN ".MAIN_DB_PREFIX.$this->table_element." b ON b.rowid = l.fk_bom"; + $sql .= " WHERE fk_bom_child = ".((int) $bom_id); $resql = $this->db->query($sql); if (!empty($resql)) { while ($res = $this->db->fetch_object($resql)) { - $TParentBom[$res->fk_bom] = $res->fk_bom; + $TParentBom[(int) $res->fk_bom] = (int) $res->fk_bom; $this->getParentBomTreeRecursive($TParentBom, $res->fk_bom, $level + 1); } }