Skip to content

Commit

Permalink
MDL-12523 enrol/manual: Fix calls to get_users_by_capability() to avo…
Browse files Browse the repository at this point in the history
…id ra

get_users_by_capability() can no longer refer to properties of role
assignments or roles, as the capability aggregate is indirect.

MDL-12452
  • Loading branch information
martinlanghoff committed Jan 6, 2008
1 parent b5ea0a4 commit f5687e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enrol/manual/enrol.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit f5687e3

Please sign in to comment.