Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49619ce
)
MDL-54894 comments: Get course from context if not informed
author
Pau Ferrer Ocaña
<crazyserver@gmail.com>
Fri, 10 Jun 2016 14:36:00 +0000
(16:36 +0200)
committer
Pau Ferrer Ocaña
<crazyserver@gmail.com>
Mon, 20 Jun 2016 06:58:05 +0000
(08:58 +0200)
comment/lib.php
patch
|
blob
|
blame
|
history
diff --git
a/comment/lib.php
b/comment/lib.php
index
7df025c
..
42b3d42
100644
(file)
--- a/
comment/lib.php
+++ b/
comment/lib.php
@@
-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