Details
Description
When moodlecourse | maxsections is empty it defaults to 0 when editing or creating a course, so the courses always have 0 topics/weeks after editing.
in the lib/adminlib.php (line 3606) the value is checked and the standard is set to 52
/** Lazy-load the available choices for the select box */
|
public function load_choices() {
|
$max = get_config('moodlecourse', 'maxsections');
|
if (empty($max)) {
|
$max = 52;
|
}
|
in course/edit_form.php (line 123) the value isn't checked and therfore not set to 52 if empty.
for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
|
$sectionmenu[$i] = "$i";
|
}
|
should check first for
if (empty($courseconfig->maxsections)) {
|
$courseconfig->maxsections = 52;
|
}
|
PS: Isn't there a more elegant way to set/check the defaults?
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-35138 Ensure default values for config settings are set
-
- Closed
-
-
MDL-25357 Allow more than 52 sections or just a section 0 in a course
-
- Closed
-
- has been marked as being related by
-
MDL-36795 In the default course settings, numsections is not limited to maxsections
-
- Closed
-