This commit is contained in:
Huong Nguyen 2024-11-28 10:45:51 +07:00
commit 376bcbe79f
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A

View File

@ -3608,14 +3608,15 @@ abstract class enrol_plugin {
$rusers = [];
if (!empty($CFG->coursecontact)) {
$croles = explode(',', $CFG->coursecontact);
[$sort, $sortparams] = users_order_by_sql('u');
[$sort] = users_order_by_sql('u');
// We only use the first user.
$i = 0;
do {
$userfieldsapi = \core_user\fields::for_name();
$allnames = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
$rusers = get_role_users($croles[$i], $context, true, 'u.id, u.confirmed, u.username, '. $allnames . ',
u.email, r.sortorder, ra.id AS raid', 'r.sortorder, ra.id ASC, ' . $sort, null, '', '', '', '', $sortparams);
$rusers = get_role_users($croles[$i], $context, true,
"u.id, u.confirmed, u.username, {$allnames}, u.email, u.maildisplay, r.sortorder, ra.id AS raid",
"r.sortorder, ra.id ASC, {$sort}");
$i++;
} while (empty($rusers) && !empty($croles[$i]));
}