This commit is contained in:
Laurent Destailleur 2022-08-11 14:36:50 +02:00
parent 98b8c81104
commit 983a530251
2 changed files with 3 additions and 2 deletions

View File

@ -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';

View File

@ -9954,7 +9954,7 @@ abstract class CommonObject
}
}
return $error ? -1 * $error : $ok;
return $error ? (-1 * $error) : $ok;
}
/**