From 924ccd683a3ca72fa9ff1000a964c43fbf5895e5 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 27 Sep 2006 14:08:17 +0000 Subject: [PATCH] Fixed up some wrong entries in the log_display table MDL-6516 NOTE: The dates are a month in advance for $version here! We need to increment very slowly until it catches up, and make sure that we manage the versions in HEAD very carefully after we branch for 1.7 --- mod/scorm/db/mysql.php | 5 +++++ mod/scorm/db/postgres7.php | 7 ++++++- mod/scorm/version.php | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mod/scorm/db/mysql.php b/mod/scorm/db/mysql.php index 6537bbae53..6108dc15b3 100755 --- a/mod/scorm/db/mysql.php +++ b/mod/scorm/db/mysql.php @@ -221,6 +221,11 @@ function scorm_upgrade($oldversion) { table_column("scorm", "", "skipview", "TINYINT", "1", "UNSIGNED", "1", "NOT NULL", "launch"); } + if ($oldversion < 2006102702) { /// A month in advance! + execute_sql("DELETE FROM {$CFG->prefix}log_display WHERE module = 'scorm' AND action = 'review' AND mtable = 'resource' AND field = 'name';", false); // MDL-6516 + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('scorm', 'review', 'scorm', 'name');", false); + } + return true; } ?> diff --git a/mod/scorm/db/postgres7.php b/mod/scorm/db/postgres7.php index 9e02e58d7f..a4d9a60a72 100755 --- a/mod/scorm/db/postgres7.php +++ b/mod/scorm/db/postgres7.php @@ -97,7 +97,7 @@ function scorm_upgrade($oldversion) { } modify_database('',"DROP TABLE prefix_scorm_sco_users"); - modify_database('',"INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'review', 'resource', 'name')"); + modify_database('',"INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'review', 'resource', 'name')"); // Wrong line! See MDL-6516 } if ($oldversion < 2005040200) { @@ -244,6 +244,11 @@ function scorm_upgrade($oldversion) { table_column("scorm", "", "skipview", "integer", "", "", "1", "NOT NULL"); } + if ($oldversion < 2006102702) { // This is a month in advance!!!!! + execute_sql("DELETE FROM {$CFG->prefix}log_display WHERE module = 'resource' AND action = 'review' AND mtable = 'resource' AND field = 'name';", false); // See MDL-6516 + execute_sql("INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('scorm', 'review', 'scorm', 'name');", false); + } + return true; } ?> diff --git a/mod/scorm/version.php b/mod/scorm/version.php index 6245400f81..748825db90 100755 --- a/mod/scorm/version.php +++ b/mod/scorm/version.php @@ -5,7 +5,7 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2006102601; // The (date) version of this module +$module->version = 2006102702; // The (date) version of this module (NOTE THIS WAS SET WRONG TO AN OCTOBER DATE IN SEPTEMBER!) $module->requires = 2006080900; // The version of Moodle that is required $module->cron = 0; // How often should cron check this module (seconds)? -- 2.39.5