Skip to content
Snippets Groups Projects
Commit e63ab857 authored by Marcos García de La Fuente's avatar Marcos García de La Fuente
Browse files

FIX #4583 Incorrect call of Categories::containing throws a DoliDB error

Close #4583
parent 2d6c2d4f
No related branches found
No related tags found
No related merge requests found
...@@ -1241,7 +1241,7 @@ class Categorie extends CommonObject ...@@ -1241,7 +1241,7 @@ class Categorie extends CommonObject
$sql = "SELECT ct.fk_categorie, c.label, c.rowid"; $sql = "SELECT ct.fk_categorie, c.label, c.rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . $id . " AND c.type = " . $this->MAP_ID[$type]; $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")"; $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
$res = $this->db->query($sql); $res = $this->db->query($sql);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment