Skip to content

Commit

Permalink
MDL-80394 core_grades: Revert changes to graded_users_iterator
Browse files Browse the repository at this point in the history
Third party plugins are using it and change was breaking it
  • Loading branch information
ilyatregubov committed Dec 13, 2023
1 parent 86716dc commit dfc7dcd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions grade/lib.php
Expand Up @@ -183,12 +183,7 @@ public function init() {
}
}

$userfieldsapi = \core_user\fields::for_identity($coursecontext, false)->with_userpic();
$userfields = $userfieldsapi->get_sql('u', false, '', '', false)->selects;

// This need to be fixed - webservices in grade/report/user/classes/external/user.php don't check permission properly.
$userfields .= ', u.idnumber, u.institution, u.department';

$userfields = 'u.*';
$customfieldssql = '';
if ($this->allowusercustomfields && !empty($CFG->grade_export_customprofilefields)) {
$customfieldscount = 0;
Expand Down Expand Up @@ -222,7 +217,8 @@ public function init() {
$this->users_rs = $DB->get_recordset_sql($users_sql, $params);

if (!$this->onlyactive) {
$this->suspendedusers = get_suspended_userids($coursecontext);
$context = context_course::instance($this->course->id);
$this->suspendedusers = get_suspended_userids($context);
} else {
$this->suspendedusers = array();
}
Expand Down

0 comments on commit dfc7dcd

Please sign in to comment.