Merge branch 'MDL-54894-31' of git://github.com/crazyserver/moodle into MOODLE_31_STABLE

This commit is contained in:
Andrew Nicols
2016-06-21 12:10:20 +08:00
+5 -1
View File
@@ -153,7 +153,11 @@ class comment {
} else if (!empty($options->courseid)) {
$this->courseid = $options->courseid;
} else {
$this->courseid = SITEID;
if ($coursecontext = $this->context->get_course_context(false)) {
$this->courseid = $coursecontext->instanceid;
} else {
$this->courseid = SITEID;
}
}
// setup coursemodule