Bug #1104 - Corrections in the upgrade scripts for proper detection of the old system's location.

skala
Ivan Tcholakov 16 years ago
parent 085ae09396
commit 623362317f
  1. 2
      main/install/index.php
  2. 5
      main/install/install.lib.php

@ -159,7 +159,7 @@ if ($_POST['step2_install'] || $_POST['step2_update_8'] || $_POST['step2_update_
$installType = 'update'; $installType = 'update';
if ($_POST['step2_update_8']) { if ($_POST['step2_update_8']) {
$emptyUpdatePath = false; $emptyUpdatePath = false;
$proposedUpdatePath = api_add_trailing_slash(empty($_POST['updatePath']) ? $_SERVER['DOCUMENT_ROOT'] : $_POST['updatePath']); $proposedUpdatePath = api_add_trailing_slash(empty($_POST['updatePath']) ? api_get_path(SYS_PATH) : $_POST['updatePath']);
if (file_exists($proposedUpdatePath)) { if (file_exists($proposedUpdatePath)) {
if (in_array($my_old_version, $update_from_version_8)) { if (in_array($my_old_version, $update_from_version_8)) {
$_POST['step2'] = 1; $_POST['step2'] = 1;

@ -410,6 +410,9 @@ function get_config_param($param, $updatePath = '') {
if (empty($updatePath) && !empty($_POST['updatePath'])) { if (empty($updatePath) && !empty($_POST['updatePath'])) {
$updatePath = $_POST['updatePath']; $updatePath = $_POST['updatePath'];
} }
if (empty($updatePath)) {
$updatePath = api_get_path(SYS_PATH);
}
$updatePath = api_add_trailing_slash(str_replace('\\', '/', realpath($updatePath))); $updatePath = api_add_trailing_slash(str_replace('\\', '/', realpath($updatePath)));
$updateFromInstalledVersionFile = ''; $updateFromInstalledVersionFile = '';
@ -1207,7 +1210,7 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
<table border="0" cellpadding="5" align="center"> <table border="0" cellpadding="5" align="center">
<tr> <tr>
<td><?php echo get_lang('OldVersionRootPath'); ?>:</td> <td><?php echo get_lang('OldVersionRootPath'); ?>:</td>
<td><input type="text" name="updatePath" size="50" value="<?php echo ($badUpdatePath && !empty($updatePath)) ? htmlentities($updatePath) : $_SERVER['DOCUMENT_ROOT'].'/old_version/'; ?>" /></td> <td><input type="text" name="updatePath" size="50" value="<?php echo ($badUpdatePath && !empty($updatePath)) ? htmlentities($updatePath) : api_get_path(SYS_SERVER_ROOT_PATH).'old_version/'; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">

Loading…
Cancel
Save