Skip to content
Browse files

accesslib: get_user_courses_bycap() fix bug introduced by refactor

The refactor that created make_context_subobj() triggered a bug.
Smack in the hand to the sloppy programmer using variables outside
of the context they were meant to be used in!
  • Loading branch information...
martinlanghoff committed Sep 19, 2007
1 parent e6560e3 commit 2123166d62d2cc9e85c316d3cd804a79a55758c1
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/accesslib.php
@@ -857,7 +857,7 @@ function get_user_courses_bycap($userid, $cap, $sess, $doanything, $sort='c.sort
// build the context obj
$c = make_context_subobj($c);
if (has_cap_fromsess($cap, $ctx, $sess, $doanything)) {
if (has_cap_fromsess($cap, $c->context, $sess, $doanything)) {
$courses[] = $c;
if ($limit > 0 && $cc++ > $limit) {

0 comments on commit 2123166

Please sign in to comment.
You can’t perform that action at this time.