Skip to content

Commit

Permalink
MDL-31466 tags: Fixed context bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal authored and Sam Hemelryk committed Mar 7, 2012
1 parent 87ab86d commit 8cd16e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tag/coursetagslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 8cd16e9

Please sign in to comment.