]> git.mjollnir.org Git - moodle.git/commitdiff
(Fixing upgrade script) Only try to disable lams if it is installed
authormartinlanghoff <martinlanghoff>
Wed, 28 Feb 2007 00:26:37 +0000 (00:26 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 28 Feb 2007 00:26:37 +0000 (00:26 +0000)
Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>

lib/db/upgrade.php

index 595a1f0ac7a6d8fa2845647aff6906c03614c691..992219e0b38b570d5b06379fa9f435c876d502dd 100644 (file)
@@ -50,8 +50,8 @@ function xmldb_main_upgrade($oldversion=0) {
         }
     }
 
-    if ($oldversion < 2006101001) {         /// Disable the LAMS module by default
-        if (!count_records('lams')) {
+    if ($oldversion < 2006101001) {         /// Disable the LAMS module by default (if it is installed)
+        if (count_records('modules', 'name', 'lams') && !count_records('lams')) {
             set_field('modules', 'visible', 0, 'name', 'lams');  // Disable it by default
         }
     }