Merge pull request #8292 from hregis/7.0_bug6

Fix: avoid error if type is not numeric
This commit is contained in:
Laurent Destailleur 2018-03-07 13:08:31 +01:00 committed by GitHub
commit 64e59c3f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1201,6 +1201,8 @@ class Categorie extends CommonObject
*/
function get_all_categories($type=null, $parent=false)
{
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE entity IN (".getEntity('category').")";
if (! is_null($type))