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:
tjhunt
2007-09-26 21:31:54 +00:00
parent 771b1a46f7
commit 3b0ee367a7
+1 -2
View File
@@ -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)) {