]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16089 entry in modules table created before calling install.php because it might...
authorskodak <skodak>
Fri, 3 Jul 2009 13:35:36 +0000 (13:35 +0000)
committerskodak <skodak>
Fri, 3 Jul 2009 13:35:36 +0000 (13:35 +0000)
lib/upgradelib.php

index 18ea138b0a7610e24a072334f18d1df136571916..420977ad723312adb96ad8ea0035a3c1764f0780 100644 (file)
@@ -431,6 +431,9 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
         /// Execute install.xml (XMLDB) - must be present in all modules
             $DB->get_manager()->install_from_xmldb_file($fullmod.'/db/install.xml');
 
+        /// Add record into modules table - may be needed in install.php already
+            $module->id = $DB->insert_record('modules', $module);
+
         /// Post installation hook - optional
             if (file_exists("$fullmod/db/install.php")) {
                 require_once("$fullmod/db/install.php");
@@ -438,9 +441,6 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
                 $post_install_function();
             }
 
-        /// Continue with the installation, roles and other stuff
-            $module->id = $DB->insert_record('modules', $module);
-
         /// Install various components
             update_capabilities($component);
             events_update_definition($component);