diff --git a/enrol/externallib.php b/enrol/externallib.php index ab0f6990dccf1..f8244225f842d 100644 --- a/enrol/externallib.php +++ b/enrol/externallib.php @@ -452,12 +452,13 @@ public static function get_potential_users($courseid, $enrolid, $search, $search $params['perpage']); $results = array(); + $requiredfields = ['id', 'fullname', 'profileimageurl', 'profileimageurlsmall']; foreach ($users['users'] as $id => $user) { // Note: We pass the course here to validate that the current user can at least view user details in this course. // The user we are looking at is not in this course yet though - but we only fetch the minimal set of // user records, and the user has been validated to have course:enrolreview in this course. Otherwise // there is no way to find users who aren't in the course in order to enrol them. - if ($userdetails = user_get_user_details($user, $course)) { + if ($userdetails = user_get_user_details($user, $course, $requiredfields)) { $results[] = $userdetails; } } diff --git a/enrol/manual/ajax.php b/enrol/manual/ajax.php index 935f19b45dbeb..a78f19c259581 100644 --- a/enrol/manual/ajax.php +++ b/enrol/manual/ajax.php @@ -90,7 +90,7 @@ } } - $roleid = optional_param('role', null, PARAM_INT); + $roleid = optional_param('roletoassign', null, PARAM_INT); $duration = optional_param('duration', 0, PARAM_FLOAT); $startdate = optional_param('startdate', 0, PARAM_INT); $recovergrades = optional_param('recovergrades', 0, PARAM_INT); diff --git a/enrol/manual/classes/enrol_users_form.php b/enrol/manual/classes/enrol_users_form.php index f7c9ee85f89b4..089810ef3c9af 100644 --- a/enrol/manual/classes/enrol_users_form.php +++ b/enrol/manual/classes/enrol_users_form.php @@ -106,10 +106,10 @@ public function definition() { $mform->addElement('cohort', 'cohortlist', get_string('selectcohorts', 'enrol_manual'), $options); $roles = get_assignable_roles($context); - $mform->addElement('select', 'role', get_string('assignrole', 'enrol_manual'), $roles); + $mform->addElement('select', 'roletoassign', get_string('assignrole', 'enrol_manual'), $roles); $keys = array_keys($roles); $defaultrole = end($keys); - $mform->setDefault('role', $defaultrole); + $mform->setDefault('roletoassign', $defaultrole); $mform->addAdvancedStatusElement('main'); diff --git a/enrol/tests/behat/behat_enrol.php b/enrol/tests/behat/behat_enrol.php index 3e6ae92429d58..ca24f1d6a43b6 100644 --- a/enrol/tests/behat/behat_enrol.php +++ b/enrol/tests/behat/behat_enrol.php @@ -95,7 +95,7 @@ public function i_enrol_user_as($userfullname, $rolename) { $this->execute("behat_forms::press_button", get_string('enrolusers', 'enrol')); if ($this->running_javascript()) { - $this->execute('behat_forms::i_set_the_field_to', array(get_string('assignroles', 'enrol_manual'), $rolename)); + $this->execute('behat_forms::i_set_the_field_to', array(get_string('assignrole', 'enrol_manual'), $rolename)); // We have a div here, not a tr. $this->execute('behat_forms::i_set_the_field_to', array(get_string('selectusers', 'enrol_manual'), $userfullname));