From 0d8509d8144c3ced3b29965aec9140ba7f1d3dc5 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 27 Jul 2018 14:42:58 +1200 Subject: [PATCH] Fix for session add/update when studentscanmark is empty but automark set to close --- add_form.php | 2 +- update_form.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/add_form.php b/add_form.php index d74f585..2b5d578 100644 --- a/add_form.php +++ b/add_form.php @@ -332,7 +332,7 @@ class mod_attendance_add_form extends moodleform { $this->_form->setConstant('previoussessiondate', $data['sessiondate']); } - if ($data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { + if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { $cm = $this->_customdata['cm']; // Check that the selected statusset has a status to use when unmarked. $sql = 'SELECT id diff --git a/update_form.php b/update_form.php index fe93200..da5c3e7 100644 --- a/update_form.php +++ b/update_form.php @@ -207,7 +207,7 @@ class mod_attendance_update_form extends moodleform { $errors['sestime'] = get_string('invalidsessionendtime', 'attendance'); } - if ($data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { + if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { $cm = $this->_customdata['cm']; // Check that the selected statusset has a status to use when unmarked. $sql = 'SELECT id