From: Janusz Dobrowolski Date: Fri, 22 Oct 2010 13:47:30 +0000 (+0000) Subject: Old package version was not uninstalled on upgrade. X-Git-Tag: v2.4.2~19^2~542 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=ebad841a13e373836a3cc77622617553a2b10d64;p=fa-stable.git Old package version was not uninstalled on upgrade. --- diff --git a/includes/packages.inc b/includes/packages.inc index da379b81..c9387233 100644 --- a/includes/packages.inc +++ b/includes/packages.inc @@ -606,7 +606,7 @@ function install_language($pkg_name) // function install_extension($pkg_name) { - global $path_to_root, $next_extension_id, $Ajax; + global $path_to_root, $installed_extensions, $next_extension_id, $Ajax; $pkg = get_pkg_or_list(array('extension', 'theme', 'chart'), $pkg_name); if ($pkg) { @@ -616,6 +616,11 @@ function install_extension($pkg_name) $ext_id = array_search_key($pkg['Package'], $local_exts, 'package'); if ($ext_id === null) $ext_id = $next_extension_id++; + else { // remove another already installed package for this language + $old_pkg = $installed_extensions[$ext_id]['package']; + if ($old_pkg) + uninstall_package($old_pkg); + } $ext = array( 'name' => $pkg['Name'], 'package' => $pkg['Package'],