mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-36795 - lib / administration: maxsections now limits the default setting for numsections.
In the default course settings, setting the maximum number topics / weeks to 0 would not change the default number of sections on the same page as any other number would. A more appropriate check has been put in place. This also incorporates a fix for MDL-28584. The course edit screen now also checks to see if maxsections is set or numeric. If it is not set or numeric then it defaults to 52.
This commit is contained in:
parent
5f1d8f2a8f
commit
d22b5faae8
2 changed files with 6 additions and 2 deletions
|
@ -3626,7 +3626,7 @@ class admin_settings_num_course_sections extends admin_setting_configselect {
|
|||
/** Lazy-load the available choices for the select box */
|
||||
public function load_choices() {
|
||||
$max = get_config('moodlecourse', 'maxsections');
|
||||
if (empty($max)) {
|
||||
if (!isset($max) || !is_numeric($max)) {
|
||||
$max = 52;
|
||||
}
|
||||
for ($i = 0; $i <= $max; $i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue