MDL-65460 core_course: fix undefined variable error
authorSimey Lameze <simey@moodle.com>
Thu, 2 May 2019 00:29:27 +0000 (08:29 +0800)
committerSimey Lameze <simey@moodle.com>
Thu, 2 May 2019 00:29:27 +0000 (08:29 +0800)
course/publish/metadata.php

index dbe7ce2..3042864 100644 (file)
@@ -46,7 +46,7 @@ $PAGE->set_pagelayout('incourse');
 $PAGE->set_title(get_string('course') . ': ' . $course->fullname);
 $PAGE->set_heading($course->fullname);
 
-$context = context_course::instance($courseid);
+$context = context_course::instance($course->id);
 if (empty($CFG->enablecoursepublishing) || !has_capability('moodle/course:publish', $context)) {
     throw new moodle_exception('nopermission');
 }