From d02bc6ce694be9f47309086411d852fe24d7244f Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 22 Jan 2007 22:32:00 +0000 Subject: [PATCH] MDL-8250 moved version include before main install to allow release info display before install --- admin/index.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/admin/index.php b/admin/index.php index aa03332ecf..9895b23310 100644 --- a/admin/index.php +++ b/admin/index.php @@ -97,6 +97,14 @@ $CFG->version = ""; } + if (is_readable("$CFG->dirroot/version.php")) { + include_once("$CFG->dirroot/version.php"); # defines $version + } + + if (!$version or !$release) { + error('Main version.php was not readable or specified');# without version, stop + } + /// Check if the main tables have been installed yet or not. if (! $tables = $db->Metatables() ) { // No tables yet at all. @@ -218,13 +226,6 @@ /// Check version of Moodle code on disk compared with database /// and upgrade if possible. - if ( is_readable("$CFG->dirroot/version.php")) { - include_once("$CFG->dirroot/version.php"); # defines $version - } - if (!$version) { - error('Main version.php was not readable or specified');# without version, stop - } - if (file_exists("$CFG->dirroot/lib/db/$CFG->dbtype.php")) { include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines old upgrades } @@ -323,11 +324,14 @@ print_footer('none'); exit; } else { - notify("Upgrade failed! (Could not update version in config table)"); + error('Upgrade failed! (Could not update version in config table)'); } /// Main upgrade not success } else { - notify("Upgrade failed! See /version.php"); + notify('Main Upgrade failed! See lib/db/upgrade.php'); + print_continue('index.php?confirmupgrade=1&confirmrelease=1'); + print_footer('none'); + die; } upgrade_log_finish(); } @@ -346,7 +350,7 @@ if ($release <> $CFG->release) { // Update the release version if (!set_config("release", $release)) { - notify("ERROR: Could not update release version in database!!"); + error("ERROR: Could not update release version in database!!"); } } -- 2.39.5