mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-13314 count_role_users was showing different count to those returned from
get_role_users(), based on patch from Patrick Pollett merged from MOODLE_19_STABLE
This commit is contained in:
parent
e08dc18dbe
commit
f405c6e4d8
1 changed files with 7 additions and 4 deletions
|
@ -4927,10 +4927,13 @@ function count_role_users($roleid, $context, $parent=false) {
|
|||
$parentcontexts = '';
|
||||
}
|
||||
|
||||
$SQL = "SELECT count(*)
|
||||
$SQL = "SELECT count(u.id)
|
||||
FROM {$CFG->prefix}role_assignments r
|
||||
JOIN {$CFG->prefix}user u
|
||||
ON u.id = r.userid
|
||||
WHERE (r.contextid = $context->id $parentcontexts)
|
||||
AND r.roleid = $roleid";
|
||||
AND r.roleid = $roleid
|
||||
AND u.deleted = 0";
|
||||
|
||||
return count_records_sql($SQL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue