diff --git a/lib/accesslib.php b/lib/accesslib.php index b819cdb1c58..bc1356d0bfd 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -3507,8 +3507,8 @@ function fetch_context_capabilities($context) { $cb = get_record('block_instance', 'id', $context->instanceid); $block = get_record('block', 'id', $cb->blockid); - $SQL = "select * from {$CFG->prefix}capabilities where contextlevel = ".CONTEXT_BLOCK." - and ( component = 'block/$block->name' or component = 'moodle')"; + $SQL = "select * from {$CFG->prefix}capabilities where (contextlevel = ".CONTEXT_BLOCK." AND component = 'moodle') + OR (component = 'block/$block->name')"; break; default: