diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 56f7c41994b..fb0bba95ac4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1926,7 +1926,7 @@ class Form $sql .= " WHERE u.entity IS NOT NULL"; } } else { - if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " ON ug.fk_user = u.rowid"; $sql .= " WHERE ug.entity = ".$conf->entity;