From 23580ddacb5e0e510f263b97a845c6ebd452fd56 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 9 Apr 2011 17:37:27 +0200 Subject: [PATCH] MDL-27121 fix incorrect check_moodle_environment() version parameter This prevents Moodle 2.0 from using environment info for 2.1 in the installer and CLI upgrade. --- admin/cli/upgrade.php | 2 +- admin/index.php | 2 +- lib/installlib.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/cli/upgrade.php b/admin/cli/upgrade.php index 7e145f2ec9a..c3e630b176b 100644 --- a/admin/cli/upgrade.php +++ b/admin/cli/upgrade.php @@ -94,7 +94,7 @@ $oldversion = "$CFG->release ($CFG->version)"; $newversion = "$release ($version)"; // test environment first -if (!check_moodle_environment($version, $environment_results, false, ENV_SELECT_RELEASE)) { +if (!check_moodle_environment(normalize_version($release), $environment_results, false, ENV_SELECT_RELEASE)) { $errors = environment_get_errors($environment_results); cli_heading(get_string('environment', 'admin')); foreach ($errors as $error) { diff --git a/admin/index.php b/admin/index.php index f40ad17512a..cb6fb58f9de 100644 --- a/admin/index.php +++ b/admin/index.php @@ -152,7 +152,7 @@ if (!core_tables_exist()) { echo $OUTPUT->box($releasenoteslink, 'generalbox releasenoteslink'); require_once($CFG->libdir.'/environmentlib.php'); - if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) { + if (!check_moodle_environment(normalize_version($release), $environment_results, true, ENV_SELECT_RELEASE)) { print_upgrade_reload("index.php?agreelicense=1&lang=$CFG->lang"); } else { echo $OUTPUT->notification(get_string('environmentok', 'admin'), 'notifysuccess'); diff --git a/lib/installlib.php b/lib/installlib.php index 3a7c822cada..daaf16ccf5b 100644 --- a/lib/installlib.php +++ b/lib/installlib.php @@ -529,7 +529,7 @@ function install_cli_database(array $options, $interactive) { } // test environment first - if (!check_moodle_environment($version, $environment_results, false, ENV_SELECT_RELEASE)) { + if (!check_moodle_environment(normalize_version($release), $environment_results, false, ENV_SELECT_RELEASE)) { $errors = environment_get_errors($environment_results); cli_heading(get_string('environment', 'admin')); foreach ($errors as $error) { -- 2.11.4.GIT