diff --git a/mod/hotpot/db/mysql.php b/mod/hotpot/db/mysql.php index 9fa8792f594..2316a94ad55 100644 --- a/mod/hotpot/db/mysql.php +++ b/mod/hotpot/db/mysql.php @@ -3,11 +3,12 @@ function hotpot_upgrade($oldversion) { global $CFG; $ok = true; + $newinstall = true; if ($oldversion < 2004021400) { execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `starttime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`"); execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `endtime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`"); - $newinstall = true; + $newinstall = false; } // update from HotPot v1 to HotPot v2 @@ -15,11 +16,13 @@ function hotpot_upgrade($oldversion) { $ok = $ok && hotpot_get_update_to_v2(); $ok = $ok && hotpot_update_to_v2_from_v1(); - if (!empty($newinstall)) { /// Disable this module by default - @set_field('modules', 'visible', '0', 'name', 'hotpot'); - } + $newinstall = false; } + if ($newinstall) { /// Disable this module by default in new installs + @set_field('modules', 'visible', '0', 'name', 'hotpot'); + } + return $ok; } function hotpot_get_update_to_v2() { diff --git a/mod/hotpot/db/postgres7.php b/mod/hotpot/db/postgres7.php index cacc4b16f70..1b9864c4ad0 100644 --- a/mod/hotpot/db/postgres7.php +++ b/mod/hotpot/db/postgres7.php @@ -2,13 +2,20 @@ function hotpot_upgrade($oldversion) { $ok = true; + $newinstall = true; // update from HotPot v1 to HotPot v2 if ($oldversion < 2005031400) { $ok = $ok && hotpot_get_update_to_v2(); $ok = $ok && hotpot_update_to_v2_from_v1(); + $newinstall = false; } + + if ($newinstall) { /// Disable this module by default in new installs + @set_field('modules', 'visible', '0', 'name', 'hotpot'); + } + return $ok; } function hotpot_get_update_to_v2() {