]> git.mjollnir.org Git - moodle.git/commitdiff
fixed error in fetch_context_capabilities() when no local capabilities defined in...
authorskodak <skodak>
Fri, 22 Sep 2006 21:31:19 +0000 (21:31 +0000)
committerskodak <skodak>
Fri, 22 Sep 2006 21:31:19 +0000 (21:31 +0000)
lib/accesslib.php

index d4440397d502c41eca098b096cc3d4c58e24ff56..2e6ede2b58e80b97c9994aba6f6be047b0f2e926 100755 (executable)
@@ -1946,7 +1946,9 @@ function fetch_context_capabilities($context) {
         return false;
     }
 
-    $records = get_records_sql($SQL.' '.$sort);
+    if (!$records = get_records_sql($SQL.' '.$sort)) {
+        $records = array();
+    }
     $contextindependentcaps = fetch_context_independent_capabilities();
     $records = array_merge($records, $contextindependentcaps);
 
@@ -2750,4 +2752,4 @@ function get_users_from_role_on_context($role, $context) {
                                   AND roleid = $role->id");
 }
 
-?>
+?>
\ No newline at end of file