Navigation Menu

Skip to content

Commit

Permalink
MDL-22309 enrol_self: Fixing get_role_users usage
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Nov 27, 2014
1 parent 22645c9 commit bc92aac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion enrol/self/lib.php
Expand Up @@ -432,7 +432,13 @@ protected function email_welcome_message($instance, $user) {
if (!empty($CFG->coursecontact)) {
$croles = explode(',', $CFG->coursecontact);
list($sort, $sortparams) = users_order_by_sql('u');
$rusers = get_role_users($croles, $context, true, '', 'r.sortorder ASC, ' . $sort, null, '', '', '', '', $sortparams);
// We only use the first user.
$i = 0;
do {
$rusers = get_role_users($croles[$i], $context, true, '',
'r.sortorder ASC, ' . $sort, null, '', '', '', '', $sortparams);
$i++;
} while (empty($rusers) && !empty($croles[$i]));
}
if ($rusers) {
$contact = reset($rusers);
Expand Down

0 comments on commit bc92aac

Please sign in to comment.