From 2974030611430a060025254e381248c020e60e65 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 19 Sep 2012 17:24:38 +0200 Subject: [PATCH] MDL-35517 course: Handle non-existing $course->maxbytes on course creation. --- course/edit_form.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/course/edit_form.php b/course/edit_form.php index 319bdac5c5b..20a010ed86b 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -156,7 +156,11 @@ class course_edit_form extends moodleform { $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); -- 2.43.0