From: martinlanghoff Date: Sun, 6 Jan 2008 23:25:15 +0000 (+0000) Subject: enrol/manual: Fix calls to get_users_by_capability() to avoid ra X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0d8466509dad1c9eac1f552b47792f8b1da28b5a;p=moodle.git enrol/manual: Fix calls to get_users_by_capability() to avoid ra get_users_by_capability() can no longer refer to properties of role assignments or roles, as the capability aggregate is indirect. MDL-12452 --- diff --git a/enrol/manual/enrol.php b/enrol/manual/enrol.php index 1f97c66fae..b25a2492f1 100644 --- a/enrol/manual/enrol.php +++ b/enrol/manual/enrol.php @@ -315,7 +315,7 @@ function cron() { if ($a->current || $a->past) { if ($teachers = get_users_by_capability($context, 'moodle/course:update', - 'u.*,ra.hidden', 'r.sortorder ASC', + 'u.*', 'u.username ASC', '', '', '', '', false)) { foreach ($teachers as $teacher) { email_to_user($teacher, $admin, $a->coursename .' '. $strexpirynotify, $strexpirynotifyemail); @@ -395,7 +395,7 @@ function print_enrolmentkeyfrom($course) { // (show the first person with update rights) if (!$contactslisted) { if ($teachers = get_users_by_capability(get_context_instance(CONTEXT_COURSE, $course->id), 'moodle/course:update', - 'u.*,ra.hidden', 'r.sortorder ASC', 0, 1, '', '', false, true)) { + 'u.*', 'u.id ASC', 0, 1, '', '', false, true)) { $teacher = array_shift($teachers); } if (!empty($teacher)) {