Permalink
Browse files

MDL-31466 tags: Fixed context bug

  • Loading branch information...
1 parent 87ab86d commit 8cd16e9d7190ac182921f33004ed572ca5f5ee2f @ankitagarwal ankitagarwal committed with Sam Hemelryk Feb 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 tag/coursetagslib.php
View
@@ -397,7 +397,7 @@ function coursetag_get_tagged_courses($tagid) {
foreach ($crs as $c) {
$course = $DB->get_record('course', array('id'=>$c->itemid));
// check if the course is hidden
- if ($course->visible == 1 || has_capability('moodle/course:viewhiddencourses', context_course::instance($course->id))) {
+ if ($course->visible == 1 || has_capability('moodle/course:viewhiddencourses', get_context_instance(CONTEXT_COURSE, $course->id))) {
$courses[$c->itemid] = $course;
}
}

0 comments on commit 8cd16e9

Please sign in to comment.