Permalink
Browse files

Merge branch 'wip-MDL-36795-MOODLE_22_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents d6347b0 + 0ceb918 commit 8725c4401bf9d7ebc61353734a48f1d4c0b4ada1 Sam Hemelryk committed Nov 26, 2012
Showing with 6 additions and 2 deletions.
  1. +5 −1 course/edit_form.php
  2. +1 −1 lib/adminlib.php
View
@@ -120,7 +120,11 @@ function definition() {
$mform->addHelpButton('format', 'format');
$mform->setDefault('format', $courseconfig->format);
- for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
+ $max = $courseconfig->maxsections;
+ if (!isset($max) || !is_numeric($max)) {
+ $max = 52;
+ }
+ for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}
$mform->addElement('select', 'numsections', get_string('numberweeks'), $sectionmenu);
View
@@ -3634,7 +3634,7 @@ public function __construct($name, $visiblename, $description, $defaultsetting)
/** 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++) {

0 comments on commit 8725c44

Please sign in to comment.