From dc74f67b38f69683cb41512f58d29eb3827529c3 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 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);