From: skodak Date: Mon, 2 Oct 2006 22:10:36 +0000 (+0000) Subject: more diagnostics in has_capability() - number instead of context object detected... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5fe9a11d96451cc07b8270e2fe1bbde2069f587f;p=moodle.git more diagnostics in has_capability() - number instead of context object detected and debug message displayed --- diff --git a/lib/accesslib.php b/lib/accesslib.php index c1567fb876..f45a01adcd 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -306,6 +306,10 @@ function has_capability($capability, $context=NULL, $userid=NULL, $doanything=tr } } + if (!is_object($context)) { + debugging('Incorrect context parameter "'.$context.'" for has_capability(), object expected! This should be fixed in code.'); + } + if ($doanything) { // Check site