diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index aa19ae09ce3..5d4167deb73 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -628,6 +628,12 @@ class Users extends DolibarrApi throw new RestException(404, 'Group not found'); } + if ($load_members > 0 && is_array($group_static->members) && count($group_static->members) > 0) { + foreach ($group_static->members as &$member) { + $member = $this->_cleanObjectDatas($member); + } + } + return $this->_cleanObjectDatas($group_static); }