From db77228155f37dfbe7243ce28504f2ad01cfc9f7 Mon Sep 17 00:00:00 2001 From: Simon Coggins Date: Tue, 20 May 2014 10:01:00 +1200 Subject: [PATCH] MDL-45623: Fix assigned users count on role delete confirmation page --- admin/roles/manage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/roles/manage.php b/admin/roles/manage.php index e3e094a45a3..6cd63abee83 100644 --- a/admin/roles/manage.php +++ b/admin/roles/manage.php @@ -75,7 +75,8 @@ switch ($action) { $a->id = $roleid; $a->name = $roles[$roleid]->name; $a->shortname = $roles[$roleid]->shortname; - $a->count = $DB->count_records('role_assignments', array('roleid'=>$roleid)); + $a->count = $DB->count_records_select('role_assignments', + 'roleid = ?', array($roleid), 'COUNT(DISTINCT userid)'); $formcontinue = new single_button(new moodle_url($baseurl, $optionsyes), get_string('yes')); $formcancel = new single_button(new moodle_url($baseurl), get_string('no'), 'get');