MDL-25708 recordsets - found one more recent use. fixed.
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 30 Jan 2011 12:43:06 +0000 (13:43 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 30 Jan 2011 12:43:06 +0000 (13:43 +0100)
grade/report/user/lib.php

index 6d66a6e..7a84094 100644 (file)
@@ -634,12 +634,11 @@ class grade_report_user extends grade_report {
                   GROUP BY gg.itemid";
 
             $sum_array = array();
-            if ($sums = $DB->get_recordset_sql($sql, $params)) {
-                foreach ($sums as $itemid => $csum) {
-                    $sum_array[$itemid] = $csum->sum;
-                }
-                $sums->close();
+            $sums = $DB->get_recordset_sql($sql, $params);
+            foreach ($sums as $itemid => $csum) {
+                $sum_array[$itemid] = $csum->sum;
             }
+            $sums->close();
 
             $columncount=0;