MDL-11466 - failing to check for the case $rs = false in the accesslib performance improvements. Credit for the fix goes to Gareth Morgan.
This commit is contained in:
+1
-2
@@ -1240,8 +1240,7 @@ function get_categories($parent='none', $sort=NULL, $shallow=true) {
|
||||
}
|
||||
$categories = array();
|
||||
|
||||
$rs = get_recordset_sql($sql);
|
||||
if ($rs->RecordCount()) {
|
||||
if( $rs = get_recordset_sql($sql) ){
|
||||
while ($cat = rs_fetch_next_record($rs)) {
|
||||
$cat = make_context_subobj($cat);
|
||||
if ($cat->visible || has_capability('moodle/course:create',$cat->context)) {
|
||||
|
||||
Reference in New Issue
Block a user