Permalink
Browse files

MDL-35517 course: Handle non-existing $course->maxbytes on course cre…

…ation.
  • Loading branch information...
1 parent c366bea commit 2974030611430a060025254e381248c020e60e65 @stronk7 stronk7 committed Sep 19, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 course/edit_form.php
@@ -156,7 +156,11 @@ function definition() {
$mform->addHelpButton('showreports', 'showreports');
$mform->setDefault('showreports', $courseconfig->showreports);
- $choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $course->maxbytes);
+ // Handle non-existing $course->maxbytes on course creation.
+ $coursemaxbytes = !isset($course->maxbytes) ? null : $course->maxbytes;
+
+ // Let's prepare the maxbytes popup.
+ $choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $coursemaxbytes);
$mform->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
$mform->addHelpButton('maxbytes', 'maximumupload');
$mform->setDefault('maxbytes', $courseconfig->maxbytes);

0 comments on commit 2974030

Please sign in to comment.