Skip to content

Commit

Permalink
Merge branch 'MDL-63683-39' of https://github.com/dravek/moodle into …
Browse files Browse the repository at this point in the history
…MOODLE_39_STABLE
  • Loading branch information
vmdef committed Dec 9, 2020
2 parents f43de82 + 9e597d3 commit 93e25f8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion enrol/cohort/settings.php
Expand Up @@ -36,7 +36,7 @@
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_cohort/roleid',
get_string('defaultrole', 'role'), '', $student->id, $options));
get_string('defaultrole', 'role'), '', $student->id ?? null, $options));

$options = array(
ENROL_EXT_REMOVED_UNENROL => get_string('extremovedunenrol', 'enrol'),
Expand Down
6 changes: 5 additions & 1 deletion enrol/database/settings.php
Expand Up @@ -86,7 +86,11 @@
$options = get_default_enrol_roles(context_system::instance());
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_database/defaultrole', get_string('defaultrole', 'enrol_database'), get_string('defaultrole_desc', 'enrol_database'), $student->id, $options));
$settings->add(new admin_setting_configselect('enrol_database/defaultrole',
get_string('defaultrole', 'enrol_database'),
get_string('defaultrole_desc', 'enrol_database'),
$student->id ?? null,
$options));
}

$settings->add(new admin_setting_configcheckbox('enrol_database/ignorehiddencourses', get_string('ignorehiddencourses', 'enrol_database'), get_string('ignorehiddencourses_desc', 'enrol_database'), 0));
Expand Down
2 changes: 1 addition & 1 deletion enrol/manual/settings.php
Expand Up @@ -63,7 +63,7 @@
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_manual/roleid',
get_string('defaultrole', 'role'), '', $student->id, $options));
get_string('defaultrole', 'role'), '', $student->id ?? null, $options));
}

$options = array(2 => get_string('coursestart'), 3 => get_string('today'), 4 => get_string('now', 'enrol_manual'));
Expand Down
2 changes: 1 addition & 1 deletion enrol/mnet/settings.php
Expand Up @@ -36,6 +36,6 @@
$student = reset($student);
$settings->add(new admin_setting_configselect_with_advanced('enrol_mnet/roleid',
get_string('defaultrole', 'role'), '',
array('value'=>$student->id, 'adv'=>true), $options));
array('value' => $student->id ?? null, 'adv' => true), $options));
}
}
5 changes: 4 additions & 1 deletion enrol/paypal/settings.php
Expand Up @@ -66,7 +66,10 @@
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_paypal/roleid',
get_string('defaultrole', 'enrol_paypal'), get_string('defaultrole_desc', 'enrol_paypal'), $student->id, $options));
get_string('defaultrole', 'enrol_paypal'),
get_string('defaultrole_desc', 'enrol_paypal'),
$student->id ?? null,
$options));
}

$settings->add(new admin_setting_configduration('enrol_paypal/enrolperiod',
Expand Down
5 changes: 4 additions & 1 deletion enrol/self/settings.php
Expand Up @@ -79,7 +79,10 @@
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_self/roleid',
get_string('defaultrole', 'enrol_self'), get_string('defaultrole_desc', 'enrol_self'), $student->id, $options));
get_string('defaultrole', 'enrol_self'),
get_string('defaultrole_desc', 'enrol_self'),
$student->id ?? null,
$options));
}

$settings->add(new admin_setting_configduration('enrol_self/enrolperiod',
Expand Down

0 comments on commit 93e25f8

Please sign in to comment.