Index: lib/grade/grade_object.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/grade/grade_object.php,v retrieving revision 1.27.2.6 diff -u -r1.27.2.6 grade_object.php --- lib/grade/grade_object.php 17 Sep 2010 03:09:29 -0000 1.27.2.6 +++ lib/grade/grade_object.php 16 Dec 2010 12:17:54 -0000 @@ -173,13 +173,14 @@ $wheresql = implode("AND", $wheresql); } - if ($datas = get_records_select($table, $wheresql, 'id')) { + if ($rs = get_recordset_select($table, $wheresql, 'id')) { $result = array(); - foreach($datas as $data) { + while ($data = rs_fetch_next_record($rs)) { $instance = new $classname(); grade_object::set_properties($instance, $data); $result[$instance->id] = $instance; } + rs_close($rs); return $result; } else {