MDL-69022 tool_moodlenet: Disable integration by default
authorMathew May <mathewm@hotmail.co.nz>
Thu, 11 Jun 2020 09:16:12 +0000 (17:16 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Thu, 11 Jun 2020 09:25:54 +0000 (17:25 +0800)
admin/tool/moodlenet/db/upgrade.php
admin/tool/moodlenet/settings.php
admin/tool/moodlenet/version.php

index 24f6beb..132feae 100644 (file)
@@ -77,5 +77,12 @@ function xmldb_tool_moodlenet_upgrade(int $oldversion) {
         upgrade_plugin_savepoint(true, 2020060500, 'tool', 'moodlenet');
     }
 
+    if ($oldversion < 2020060500.02) {
+        // Disable the MoodleNet integration by default till further notice.
+        set_config('enablemoodlenet', 0, 'tool_moodlenet');
+
+        upgrade_plugin_savepoint(true, 2020060500.02, 'tool', 'moodlenet');
+    }
+
     return true;
 }
index 4b6fb4f..089070d 100644 (file)
@@ -32,7 +32,7 @@ if ($hassiteconfig) {
     $ADMIN->add('moodlenet', $settings);
 
     $temp = new admin_setting_configcheckbox('tool_moodlenet/enablemoodlenet', get_string('enablemoodlenet', 'tool_moodlenet'),
-        new lang_string('enablemoodlenet_desc', 'tool_moodlenet'), 1, 1, 0);
+        new lang_string('enablemoodlenet_desc', 'tool_moodlenet'), 0, 1, 0);
     $settings->add($temp);
 
     $temp = new admin_setting_configtext('tool_moodlenet/defaultmoodlenetname',
index d6a7b6e..ba9f786 100644 (file)
@@ -25,6 +25,6 @@
 defined('MOODLE_INTERNAL') || die();
 
 $plugin->component  = 'tool_moodlenet';
-$plugin->version    = 2020060500;
+$plugin->version    = 2020060500.02;
 $plugin->requires   = 2020022800.01;
 $plugin->maturity   = MATURITY_ALPHA;