Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ation.
  • Loading branch information...
commit 2974030611430a060025254e381248c020e60e65 1 parent c366bea
@stronk7 stronk7 authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 course/edit_form.php
View
6 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);
Please sign in to comment.
Something went wrong with that request. Please try again.