diff --git a/lib.php b/lib.php index 737d5e7..134288b 100644 --- a/lib.php +++ b/lib.php @@ -54,12 +54,13 @@ function attendance_supports($feature) { function att_add_default_statuses($attid) { global $DB; - $statuses = $DB->get_records('attendance_statuses', array('attendanceid'=> 0), 'id'); + $statuses = $DB->get_recordset('attendance_statuses', array('attendanceid'=> 0), 'id'); foreach ($statuses as $st) { $rec = $st; $rec->attendanceid = $attid; $DB->insert_record('attendance_statuses', $rec); } + $statuses->close(); } function attendance_add_instance($attendance) { diff --git a/locallib.php b/locallib.php index d52ceed..2977b34 100644 --- a/locallib.php +++ b/locallib.php @@ -1267,12 +1267,13 @@ class attendance { global $DB; $now = time(); - $sessions = $DB->get_records_list('attendance_sessions', 'id', $sessionsids); + $sessions = $DB->get_recordset_list('attendance_sessions', 'id', $sessionsids); foreach ($sessions as $sess) { $sess->duration = $duration; $sess->timemodified = $now; $DB->update_record('attendance_sessions', $sess); } + $sessions->close(); add_to_log($this->course->id, 'attendance', 'sessions duration updated', $this->url_manage(), get_string('sessionsids', 'attendance').implode(', ', $sessionsids), $this->cm->id); }