From bc505c98a0424a64dd7fb01ba3b2bb736e5cd41d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Feb 2013 21:10:31 +0100 Subject: [PATCH] Test to avoid infinite loop --- htdocs/product/class/product.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fc0c08e736f..c92b94b0b6e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2321,7 +2321,7 @@ class Product extends CommonObject } /** - * Return childs of prodcut with if fk_parent + * Return childs of product with if fk_parent * * @param int $fk_parent Id of product to search childs of * @return array Prod @@ -2333,7 +2333,9 @@ class Product extends CommonObject $sql.= ", ".MAIN_DB_PREFIX."product_association as pa"; $sql.= " WHERE p.rowid = pa.fk_product_fils"; $sql.= " AND pa.fk_product_pere = ".$fk_parent; + $sql.= " AND pa.fk_product_fils != ".$fk_parent; // This should not happens, it is to avoid invinite loop if it happens + dol_syslog(get_class($this).'::getChildsArbo sql='.$sql); $res = $this->db->query($sql); if ($res) {