From 43f1dbad596736b6e138823198132e5d2285a368 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 23 Jul 2021 12:18:13 +1200 Subject: [PATCH] Tidy up field definition. --- classes/structure.php | 3 +++ db/install.xml | 2 +- db/upgrade.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/structure.php b/classes/structure.php index d70347f..bd03cee 100644 --- a/classes/structure.php +++ b/classes/structure.php @@ -534,6 +534,9 @@ class mod_attendance_structure { $sess->rotateqrcode = 0; $sess->rotateqrcodesecret = ''; } + if (!isset($sess->automarkcmid)) { + $sess->automarkcmid = null; + } $event->add_record_snapshot('attendance_sessions', $sess); $event->trigger(); diff --git a/db/install.xml b/db/install.xml index 8a0f170..7aba70a 100755 --- a/db/install.xml +++ b/db/install.xml @@ -52,7 +52,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index 5ea87d9..c8974b2 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -654,7 +654,7 @@ function xmldb_attendance_upgrade($oldversion=0) { // Changing precision of field statusset on table attendance_log to (1333). $table = new xmldb_table('attendance_sessions'); - $field = new xmldb_field('automarkcmid', XMLDB_TYPE_CHAR, '10', null, null, null, null, 'rotateqrcodesecret'); + $field = new xmldb_field('automarkcmid', XMLDB_TYPE_CHAR, '10', null, false, null, null, 'rotateqrcodesecret'); // Launch change of precision for field statusset. if (!$dbman->field_exists($table, $field)) {