Merge branch 'MDL-65495-master-courseid' of git://github.com/mudrd8mz/moodle
authorAdrian Greeve <abgreeve@gmail.com>
Tue, 7 May 2019 01:53:17 +0000 (09:53 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Tue, 7 May 2019 08:26:46 +0000 (16:26 +0800)
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');
 }