MDL-40088 fixed bug with not visible course section
authorMarina Glancy <marina@moodle.com>
Fri, 7 Jun 2013 03:55:19 +0000 (13:55 +1000)
committerMarina Glancy <marina@moodle.com>
Fri, 7 Jun 2013 03:55:19 +0000 (13:55 +1000)
course/edit_form.php

index 13ab045..c845331 100644 (file)
@@ -81,7 +81,7 @@ class course_edit_form extends moodleform {
                 $displaylist = coursecat::make_categories_list('moodle/course:create');
                 if (!isset($displaylist[$course->category])) {
                     //always keep current
-                    $displaylist[$course->category] = coursecat::get($course->category)->get_formatted_name();
+                    $displaylist[$course->category] = coursecat::get($course->category, MUST_EXIST, true)->get_formatted_name();
                 }
                 $mform->addElement('select', 'category', get_string('coursecategory'), $displaylist);
                 $mform->addHelpButton('category', 'coursecategory');