Details
-
Bug
-
Resolution: Fixed
-
Trivial
-
1.7.4, 1.8.2
-
None
-
any
-
MOODLE_17_STABLE, MOODLE_18_STABLE
-
MOODLE_18_STABLE, MOODLE_19_STABLE
Description
When assigning roles to a course the script /admin/roles/assign.php first give a quick summary of roles and the
current number of users having these roles.
Unfortunately the numbers are wrong , and do not match what is seen when getting role's details, since the called API function lib/accesslib.php/count_role_users do not filter out deleted users, i.e. users having the flag deleted set ...
current SQL is :
$SQL = "SELECT count
FROM {$CFG->prefix}role_assignments r
WHERE (r.contextid = $context->id $parentcontexts)
AND r.roleid = $roleid";
where it should be :
$SQL = "SELECT count
FROM {$CFG->prefix}role_assignments r,{$CFG->prefix}user u
WHERE (r.contextid = $context->id $parentcontexts)
AND r.roleid = $roleid
AND r.userid=u.id
AND not u.deleted";
According to phpxref , this function is called only from admin/roles/assign.php, so this patch should be without other consequences.
Cheers.
Attachments
Issue Links
- will help resolve
-
MDL-12818 Weird roles assign screen notice after upgrade
-
- Closed
-