MDL-60812 enrol_manual: Fixes not working default role

This commit is contained in:
wehr 2018-01-12 16:13:27 +01:00
parent f5b956679e
commit 122c999536

View File

@ -123,9 +123,7 @@ class enrol_manual_enrol_users_form extends moodleform {
$roles = get_assignable_roles($context);
$mform->addElement('select', 'roletoassign', get_string('assignrole', 'enrol_manual'), $roles);
$keys = array_keys($roles);
$defaultrole = end($keys);
$mform->setDefault('roletoassign', $defaultrole);
$mform->setDefault('roletoassign', $instance->roleid);
$mform->addAdvancedStatusElement('main');