Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-27906 calendar event: fixed retrieving coursemodule by replacing …

…get_coursemodule_from_id() to get_coursemodule_from_instance()
  • Loading branch information...
commit 18d63ffb674c35b871209dbb8168403fddfaad3a 1 parent 7a7d34f
rwijaya rwijaya authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  calendar/lib.php
2  calendar/lib.php
View
@@ -1887,7 +1887,7 @@ protected function calculate_context(stdClass $data) {
$context = get_context_instance(CONTEXT_USER);
} else if (isset($data->userid) && $data->userid > 0 && $data->userid != $USER->id &&
isset($data->instance) && $data->instance > 0) {
- $cm = get_coursemodule_from_id('', $data->instance, 0, false, MUST_EXIST);
+ $cm = get_coursemodule_from_instance($data->modulename, $data->instance, 0, false, MUST_EXIST);
$context = get_context_instance(CONTEXT_COURSE, $cm->course);
} else {
$context = get_context_instance(CONTEXT_USER);
Please sign in to comment.
Something went wrong with that request. Please try again.