diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a3a72d4894a..27b00377411 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2072,7 +2072,7 @@ abstract class CommonObject $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { $sql .= " AND ug.fk_user = te.rowid"; - $sql .= " AND ug.entity IN (".getEntity($this->element).")"; + $sql .= " AND ug.entity IN (".getEntity('usergroup').")"; } } else { $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; @@ -2142,7 +2142,7 @@ abstract class CommonObject $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { $sql .= " AND ug.fk_user = te.rowid"; - $sql .= " AND ug.entity IN (".getEntity($this->element).")"; + $sql .= " AND ug.entity IN (".getEntity('usergroup').")"; } } else { $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 04eebd6b6c9..1543d579839 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3490,7 +3490,7 @@ class User extends CommonObject } else { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ((ug.fk_user = t.rowid"; - $sql .= " AND ug.entity IN (".getEntity('user')."))"; + $sql .= " AND ug.entity IN (".getEntity('usergroup')."))"; $sql .= " OR t.entity = 0)"; // Show always superadmin } } else {