Categorie class was fetching an object even if no param passed

This commit is contained in:
Maxime Kohlhaas 2014-07-25 14:11:31 +02:00
parent 2e18fa88d1
commit 386022947a

View File

@ -75,6 +75,9 @@ class Categorie extends CommonObject
{ {
global $conf; global $conf;
// Check parameters
if (empty($id) && empty($label)) return -1;
$sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type"; $sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie";
if ($id) if ($id)