]> git.mjollnir.org Git - moodle.git/commitdiff
Prevent warnings for user when upgrading to mnet MDL-8082
authormoodler <moodler>
Fri, 5 Jan 2007 08:51:14 +0000 (08:51 +0000)
committermoodler <moodler>
Fri, 5 Jan 2007 08:51:14 +0000 (08:51 +0000)
lib/db/upgrade.php

index 1042389d442ffa1d4c180553f3e890c63fa1665f..0693f3d029ca8c0e21c11252066bf1e7ee09965d 100644 (file)
@@ -19,7 +19,7 @@
 
 function xmldb_main_upgrade($oldversion=0) {
 
-    global $CFG, $THEME, $db;
+    global $CFG, $THEME, $USER, $db;
 
     $result = true;
 
@@ -385,6 +385,10 @@ function xmldb_main_upgrade($oldversion=0) {
         // Create the table
         $result = $result && create_table($table);
 
+        if (empty($USER->mnet_host_id)) {
+            $USER->mnet_host_id = 1;    // Something for the current user to prevent warnings
+        }
+
         /**
          ** enrol/mnet tables
          **/