From: Dan Marsden Date: Fri, 5 Jun 2015 01:19:59 +0000 (+1200) Subject: Fix #93 $record needs an id. X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=dc74f67b38f69683cb41512f58d29eb3827529c3;p=moodle-mod_attendance.git Fix #93 $record needs an id. --- diff --git a/locallib.php b/locallib.php index 3741bfe..8df8c25 100644 --- a/locallib.php +++ b/locallib.php @@ -870,9 +870,9 @@ class attendance { // Already recorded do not save. return false; } - else { - $DB->insert_record('attendance_log', $record, false); - } + + $logid = $DB->insert_record('attendance_log', $record, false); + $record->id = $logid; // Update the session to show that a register has been taken, or staff may overwrite records. $session = $this->get_session_info($mformdata->sessid);