From 065eb108f775200f94fcbba132a6f0996c1ae639 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 11 Jan 2015 17:24:33 +0100 Subject: [PATCH] Fixed regresion in inst_upgrade.php --- admin/inst_upgrade.php | 11 +++++------ sql/alter2.4.sql | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/admin/inst_upgrade.php b/admin/inst_upgrade.php index e7b4667c..16eee5a7 100644 --- a/admin/inst_upgrade.php +++ b/admin/inst_upgrade.php @@ -52,16 +52,13 @@ function get_installers() // // Apply one differential data set. // -function upgrade_step($inst, $company, $conn) +function upgrade_step($inst, $company, $conn, $force) { global $path_to_root; $pref = $conn['tbpref']; $ret = true; - $force = get_post('force_'.$index); - if ($force || get_post('install_'.$index)) - { $state = $inst->installed($pref); if (!$state || $force) { @@ -85,7 +82,6 @@ function upgrade_step($inst, $company, $conn) display_error(_("Upgrade cannot be done because database has been already partially upgraded. Please downgrade database to clean previous version or try forced upgrade.")); $ret = false; } - } return $ret; } @@ -110,7 +106,10 @@ if (get_post('Upgrade')) foreach ($installers as $i => $inst) { - $ret = upgrade_step($installers[$index], $i, $comp, $conn); + $force = get_post('force_'.$i); + if ($force || get_post('install_'.$i)) + $ret = upgrade_step($installers[$i], $comp, $conn, $force); + if (!$ret) { display_error( diff --git a/sql/alter2.4.sql b/sql/alter2.4.sql index 2d5725e6..1ab1effb 100644 --- a/sql/alter2.4.sql +++ b/sql/alter2.4.sql @@ -2,7 +2,7 @@ ALTER TABLE `0_suppliers` ADD COLUMN `tax_algorithm` tinyint(1) NOT NULL defaul ALTER TABLE `0_supp_trans` ADD COLUMN `tax_algorithm` tinyint(1) NULL default '1' AFTER `tax_included`; INSERT INTO `0_sys_prefs` VALUES('tax_algorithm','glsetup.customer', 'tinyint', 1, '1'); INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, ''); -ALTER TABLE `0_audit_trail` CHANGE `fiscal_year` int(11) NOT NULL default 0, +ALTER TABLE `0_audit_trail` CHANGE `fiscal_year` `fiscal_year` int(11) NOT NULL default 0; # Fix eventual invalid date/year in audit records UPDATE `0_audit_trail` audit -- 2.30.2