From 16e2e2f3940de1db5b8e3e9b13981333e3ddb4af Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 22 Sep 2006 21:31:19 +0000 Subject: [PATCH] fixed error in fetch_context_capabilities() when no local capabilities defined in context --- lib/accesslib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index d4440397d5..2e6ede2b58 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -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 -- 2.39.5