Skip to content

Commit

Permalink
Ensure 'verifyany' length is valid on all sites (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Jan 23, 2024
1 parent 5881863 commit 5b0f5d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<FIELD NAME="intro" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="requiredtime" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="verifyany" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="verifyany" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="deliveryoption" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="emailstudents" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="emailteachers" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
Expand Down
13 changes: 13 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,18 @@ function xmldb_customcert_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2023042404, 'customcert');
}

if ($oldversion < 2023042405) {
// Changing precision of field verifyany on table customcert to (1).
$table = new xmldb_table('customcert');
$field = new xmldb_field('verifyany', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0',
'requiredtime');

// Launch change of precision for field verifyany.
$dbman->change_field_precision($table, $field);

// Customcert savepoint reached.
upgrade_mod_savepoint(true, 2023042405, 'customcert');
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');

$plugin->version = 2023042404; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2023042405; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2023042400; // Requires this Moodle version (4.2).
$plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->component = 'mod_customcert';
Expand Down

0 comments on commit 5b0f5d0

Please sign in to comment.