capability report: MDL-17410 did not work if a capability was not set anywhere.

Change it so that the system context is always shown.
This commit is contained in:
tjhunt
2008-12-03 02:40:17 +00:00
parent 189f3ee9bf
commit 2aa3baedc7
+1 -1
View File
@@ -106,7 +106,7 @@ if ($capability) {
SELECT DISTINCT con.path, 1
FROM {context} con JOIN {role_capabilities} rc ON rc.contextid = con.id
WHERE capability = ? $sqlroletest", $params);
$requiredcontexts = array();
$requiredcontexts = array($systemcontext->id);
foreach ($relevantpaths as $path => $notused) {
$requiredcontexts = array_merge($requiredcontexts, explode('/', trim($path, '/')));
}