MDL-57756 mod_lti: params change to text type
authorClaude Vervoort <claude.vervoort@cengage.com>
Thu, 1 Oct 2020 19:12:15 +0000 (15:12 -0400)
committerClaude Vervoort <claude.vervoort@cengage.com>
Thu, 1 Oct 2020 21:37:29 +0000 (17:37 -0400)
mod/lti/db/install.xml
mod/lti/db/upgrade.php
mod/lti/version.php

index 2c5af4c..b154923 100644 (file)
@@ -20,7 +20,7 @@
         <FIELD NAME="instructorchoicesendemailaddr" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Send user's email"/>
         <FIELD NAME="instructorchoiceallowroster" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Allow the roster to be retrieved"/>
         <FIELD NAME="instructorchoiceallowsetting" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Allow a tool to store a setting"/>
-        <FIELD NAME="instructorcustomparameters" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Additional custom parameters provided by the instructor"/>
+        <FIELD NAME="instructorcustomparameters" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Additional custom parameters provided by the instructor"/>
         <FIELD NAME="instructorchoiceacceptgrades" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Accept grades from tool"/>
         <FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="100" SEQUENCE="false" COMMENT="Grade scale"/>
         <FIELD NAME="launchcontainer" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Launch external tool in a pop-up"/>
index 5712845..7190e27 100644 (file)
@@ -169,5 +169,19 @@ function xmldb_lti_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    if ($oldversion < 2021052501) {
+
+        // Changing type of field instructorcustomparameters on table lti to text.
+        $table = new xmldb_table('lti');
+        $field = new xmldb_field('instructorcustomparameters', XMLDB_TYPE_TEXT, null, null, null, null, null,
+                'instructorchoiceallowsetting');
+
+        // Launch change of type for field value.
+        $dbman->change_field_type($table, $field);
+
+        // Lti savepoint reached.
+        upgrade_mod_savepoint(true, 2021052501, 'lti');
+    }
+
     return true;
 }
index 00f7e08..364087d 100644 (file)
@@ -48,7 +48,7 @@
 
 defined('MOODLE_INTERNAL') || die;
 
-$plugin->version   = 2021052500;    // The current module version (Date: YYYYMMDDXX).
+$plugin->version   = 2021052501;    // The current module version (Date: YYYYMMDDXX).
 $plugin->requires  = 2021052500;    // Requires this Moodle version.
 $plugin->component = 'mod_lti';     // Full name of the plugin (used for diagnostics).
 $plugin->cron      = 0;