From ffd486e3d65067845b5be2d4de026a1382820216 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 7 Oct 2016 22:54:08 +0200 Subject: [PATCH] Fix #5843 best way fixing --- htdocs/categories/class/categorie.class.php | 31 +++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 2b88eaae209..b3cb3d9cc52 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -590,23 +590,24 @@ class Categorie extends CommonObject $resql=$this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql) > 0) { + if ($this->db->num_rows($resql) > 0) + { $objparent = $this->db->fetch_object($resql); - if (!empty($objparent->fk_parent)) { - $cat = new Categorie($this->db); - $cat->id = $objparent->fk_parent; - - if (!$cat->containsObject($type, $obj->id)) { - $result = $cat->add_type($obj, $type); - if ($result < 0) { - $this->error = $cat->error; - $error++; - } - - } - } - } + if (!empty($objparent->fk_parent)) + { + $cat = new Categorie($this->db); + $cat->id = $objparent->fk_parent; + if (!$cat->containsObject($type, $obj->id)) { + $result = $cat->add_type($obj, $type); + if ($result < 0) + { + $this->error = $cat->error; + $error++; + } + } + } + } } else {