From e63ab857d8b91af98664768b3a43b1cb0cdec621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 2 Mar 2016 11:21:56 +0100 Subject: [PATCH] FIX #4583 Incorrect call of Categories::containing throws a DoliDB error Close #4583 --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 18f13a44813..e1e44a475ed 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1241,7 +1241,7 @@ class Categorie extends CommonObject $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 .= " 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 ) . ")"; $res = $this->db->query($sql);