From f28db22d064d2a0a187ef79f7ce76d3e83c9c79b Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 29 Jul 2004 18:44:57 +0000 Subject: [PATCH] Fixed duplicate in log_display, and improved installation for non-English users --- admin/index.php | 39 ++++++++++++++++++++------------------- lib/db/mysql.php | 6 ++++++ lib/db/mysql.sql | 1 - lib/db/postgres7.php | 8 ++++++++ lib/db/postgres7.sql | 1 - version.php | 2 +- 6 files changed, 35 insertions(+), 22 deletions(-) diff --git a/admin/index.php b/admin/index.php index c3325fc98f..c93cd14e18 100644 --- a/admin/index.php +++ b/admin/index.php @@ -122,6 +122,26 @@ 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. @@ -193,25 +213,6 @@ } -/// 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 diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 75615d929b..281743049d 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -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; diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index ccb439a285..c9a0c01777 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -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'); diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 064268e7f0..f247e660c9 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -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; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index ac324ab602..204481bacb 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -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'); diff --git a/version.php b/version.php index 88b8862194..33d8f31a1e 100644 --- a/version.php +++ b/version.php @@ -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 -- 2.39.5