MDL-65495 hub: Fix undefined variable usage
authorDavid Mudrák <david@moodle.com>
Mon, 6 May 2019 10:46:43 +0000 (12:46 +0200)
committerDavid Mudrák <david@moodle.com>
Mon, 6 May 2019 10:46:43 +0000 (12:46 +0200)
course/publish/backup.php

index 5194773..f9f9d7a 100644 (file)
@@ -46,7 +46,7 @@ $hubcourseid = required_param('hubcourseid', PARAM_INT);
 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
 require_login($course);
 
-$context = context_course::instance($courseid);
+$context = context_course::instance($course->id);
 if (empty($CFG->enablecoursepublishing) || !has_capability('moodle/course:publish', $context) || !confirm_sesskey()) {
     throw new moodle_exception('nopermission');
 }