From 983a53025163c5fcc31ed8d1d33d6d83513faed6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Aug 2022 14:36:50 +0200 Subject: [PATCH] Log --- htdocs/categories/class/categorie.class.php | 3 ++- htdocs/core/class/commonobject.class.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8d26b5583d4..b222f70110a 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -703,13 +703,14 @@ class Categorie extends CommonObject $type = $obj->element; } + dol_syslog(get_class($this).'::add_type', LOG_DEBUG); + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]); $sql .= " (fk_categorie, fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type]).")"; $sql .= " VALUES (".((int) $this->id).", ".((int) $obj->id).")"; - dol_syslog(get_class($this).'::add_type', LOG_DEBUG); if ($this->db->query($sql)) { if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) { $sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6d460dfadf0..aead087a9bc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9954,7 +9954,7 @@ abstract class CommonObject } } - return $error ? -1 * $error : $ok; + return $error ? (-1 * $error) : $ok; } /**