X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpackages.inc;h=c9387233e8b354618bc20e6961805ed339314994;hb=34bfbfad2dd0239174e03f7cce2b0bdcfa6a8a10;hp=da379b8100729632e62a6a5aa85a2bb9e2afe928;hpb=6108acadfe6369362f469909f8dac47c17d21322;p=fa-stable.git 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'],