Skip to content

Commit

Permalink
MDL-35517 course: Handle non-existing $course->maxbytes on course cre…
Browse files Browse the repository at this point in the history
…ation.
  • Loading branch information
stronk7 committed Sep 20, 2012
1 parent f9a8571 commit 909c277
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion course/edit_form.php
Expand Up @@ -150,7 +150,11 @@ function definition() {
$mform->addHelpButton('showreports', 'showreports'); $mform->addHelpButton('showreports', 'showreports');
$mform->setDefault('showreports', $courseconfig->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->addElement('select', 'maxbytes', get_string('maximumupload'), $choices);
$mform->addHelpButton('maxbytes', 'maximumupload'); $mform->addHelpButton('maxbytes', 'maximumupload');
$mform->setDefault('maxbytes', $courseconfig->maxbytes); $mform->setDefault('maxbytes', $courseconfig->maxbytes);
Expand Down

0 comments on commit 909c277

Please sign in to comment.