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)) {