From a8e434040de9433829dc7baf324cd1660ee1fe61 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 5 Jun 2015 13:19:59 +1200 Subject: [PATCH] Fix #93 $record needs an id. --- locallib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locallib.php b/locallib.php index 8a160b9..f003c73 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);