Fixes for the new enrol users popup with behat.
$params['perpage']);
$results = array();
$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.
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;
}
}
$results[] = $userdetails;
}
}
- $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);
$duration = optional_param('duration', 0, PARAM_FLOAT);
$startdate = optional_param('startdate', 0, PARAM_INT);
$recovergrades = optional_param('recovergrades', 0, PARAM_INT);
$mform->addElement('cohort', 'cohortlist', get_string('selectcohorts', 'enrol_manual'), $options);
$roles = get_assignable_roles($context);
$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);
$keys = array_keys($roles);
$defaultrole = end($keys);
- $mform->setDefault('role', $defaultrole);
+ $mform->setDefault('roletoassign', $defaultrole);
$mform->addAdvancedStatusElement('main');
$mform->addAdvancedStatusElement('main');
$this->execute("behat_forms::press_button", get_string('enrolusers', 'enrol'));
if ($this->running_javascript()) {
$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));
// We have a div here, not a tr.
$this->execute('behat_forms::i_set_the_field_to', array(get_string('selectusers', 'enrol_manual'), $userfullname));