]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed duplicate in log_display, and improved installation
authormoodler <moodler>
Thu, 29 Jul 2004 18:44:57 +0000 (18:44 +0000)
committermoodler <moodler>
Thu, 29 Jul 2004 18:44:57 +0000 (18:44 +0000)
for non-English users

admin/index.php
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
version.php

index c3325fc98f85d7a30ab4e18f3cbc1760be27b0ea..c93cd14e183ed6582226d317ea722a0008172280 100644 (file)
         die;
     }
 
+
+/// Insert default values for any important configuration variables
+
+    include_once("$CFG->dirroot/lib/defaults.php");
+
+    foreach ($defaults as $name => $value) {
+        if (!isset($CFG->$name)) {
+            $CFG->$name = $value;
+            set_config($name, $value);
+            $configchange = true;
+        }
+    }
+
+/// If any new configurations were found then send to the config page to check
+
+    if (!empty($configchange)) {
+        redirect("config.php");
+    }
+
+
 /// Check version of Moodle code on disk compared with database
 /// and upgrade if possible.
 
     }
 
 
-/// Insert default values for any important configuration variables
-
-    include_once("$CFG->dirroot/lib/defaults.php");
-
-    foreach ($defaults as $name => $value) {
-        if (!isset($CFG->$name)) {
-            $CFG->$name = $value;
-            set_config($name, $value);
-            $configchange = true;
-        }
-    }
-
-/// If any new configurations were found then send to the config page to check
-
-    if (!empty($configchange)) {
-        redirect("config.php");
-    }
-
-
 /// Upgrade backup/restore system if necessary
     require_once("$CFG->dirroot/backup/lib.php");
     upgrade_backup_db("$CFG->wwwroot/$CFG->admin/index.php");  // Return here afterwards
index 75615d929b3ef8733b8b11b8429592d331b43eee..281743049d5e9686c1c5822c6f8238888b86674c 100644 (file)
@@ -794,6 +794,12 @@ function main_upgrade($oldversion=0) {
         table_column('course', '', 'enrolperiod', 'int', '10', 'unsigned', '0', 'not null', 'startdate');
     }
 
+    if ($oldversion < 2004072901) {  // Fixing error in schema
+        if ($record = get_record('log_display', 'module', 'course', 'action', 'update')) {
+            delete_records('log_display', 'module', 'course', 'action', 'update');
+            insert_record('log_display', $record, false, 'module');
+        }
+    }
 
     return $result;
 
index ccb439a285c128d847ccda292a0034867123739f..c9a0c01777f6e92323981c765cccbce17cd4e8e0 100644 (file)
@@ -432,4 +432,3 @@ INSERT INTO prefix_log_display VALUES ('course', 'user report', 'user', 'CONCAT(
 INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
 INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
 INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
-INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
index 064268e7f0b6b131daf1dfd4878bd54927cac872..f247e660c94029910fa1787bc74e0273f8a52e1d 100644 (file)
@@ -536,6 +536,14 @@ function main_upgrade($oldversion=0) {
         table_column('course', '', 'enrolperiod', 'int', '10', 'unsigned', '0', 'not null', 'startdate');
     }
 
+    if ($oldversion < 2004072901) {  // Fixing error in schema
+        if ($record = get_record('log_display', 'module', 'course', 'action', 'update')) {
+            delete_records('log_display', 'module', 'course', 'action', 'update');
+            insert_record('log_display', $record, false, 'module');
+        }
+    }
+
+
     return $result;
 
 }
index ac324ab6023d5448803b27ed78c82a4413d9d2a4..204481bacbadb877715d604eedb3ac4f2fce2f68 100644 (file)
@@ -285,4 +285,3 @@ INSERT INTO prefix_log_display VALUES ('course', 'user report', 'user', 'CONCAT(
 INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
 INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
 INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
-INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
index 88b8862194a012cbf1b155f72cf6991ec1be0984..33d8f31a1ec9d665bdef5a11b743d730ffc05944 100644 (file)
@@ -5,7 +5,7 @@
 // database to determine whether upgrades should
 // be performed (see lib/db/*.php)
 
-$version = 2004072900;   // The current version is a date (YYYYMMDDXX)
+$version = 2004072901;   // The current version is a date (YYYYMMDDXX)
 
 $release = "1.4 development";   // User-friendly version number