From 4051efc119cc88d5e6851e2b0ee5d2e63feb58bd Mon Sep 17 00:00:00 2001 From: Ilya Tregubov Date: Wed, 13 Dec 2023 09:32:44 +0800 Subject: [PATCH] MDL-80394 core_grades: Revert changes to graded_users_iterator Third party plugins are using it and change was breaking it --- grade/lib.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/grade/lib.php b/grade/lib.php index 02744dee562..43bdacc6e59 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -183,12 +183,7 @@ class graded_users_iterator { } } - $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; @@ -222,7 +217,8 @@ class graded_users_iterator { $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(); } -- 2.11.4.GIT