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:
Adrian Greeve
2012-11-26 14:41:50 +08:00
parent f42c34a38a
commit 341bfedf90
3 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -3818,7 +3818,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++) {