From 45a035785b9a820621da56dec93078b3ccd9832e Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 23 Oct 2009 20:32:42 +0000 Subject: [PATCH] Fixed extension module update and deletion. --- CHANGELOG.txt | 8 ++++++++ admin/inst_module.php | 28 ++++++---------------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 113c0ab5..00ef8615 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,6 +21,14 @@ $ -> Affected files ------------------------------- Release 2.2 RC ---------------------------------- +23-Oct-2009 Janusz Dobrowolski +# Fixed 2.2 upgrade pre_check +$ /sql/alter2.2.php +# Fixed check_table() to avoid sparse messages in error log +$ /admin/inst_update.php +# Fixed module update and deletion. +$ /admin/inst_module.php + 22-Oct-2009 Tom Hallman + Added generic tags support and tags for dimensions/gl accounts. $ /applications/dimensions.php diff --git a/admin/inst_module.php b/admin/inst_module.php index 3571b692..2329146c 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -92,7 +92,7 @@ function handle_submit() return false; $id = $selected_id==-1 ? $next_extension_id : $selected_id; - if ($extensions[$id]['type'] != 'plugin') { + if ($selected_id != -1 && $extensions[$id]['type'] != 'plugin') { display_error(_('Module installation support is not implemented yet. You have to do it manually.')); return; } @@ -101,7 +101,7 @@ function handle_submit() $extensions[$id]['name'] = $_POST['name']; $extensions[$id]['path'] = $_POST['path']; $extensions[$id]['title'] = $_POST['title']; - $extensions[$id]['active'] = $_POST['active']; + $extensions[$id]['active'] = check_value('active'); // Currently we support only plugin extensions here. $extensions[$id]['type'] = 'plugin'; @@ -171,32 +171,16 @@ function handle_delete() $extensions = get_company_extensions(); $id = $selected_id; - $removed_ext = $extensions[$id]; - - unset($extensions[$id]); - $mods = array_values($extensions); - $extensions = $mods; - - unset($extensions[$id]); - - update_extensions($extensions); $filename = $path_to_root . ($extensions[$id]['type']=='plugin' ? "/modules/": '/') . $extensions[$id]['path']; - if ($h = opendir($filename)) - { - while (($file = readdir($h)) !== false) - { - if (is_file("$filename/$file")) - unlink("$filename/$file"); - } - closedir($h); - } + flush_dir($filename); rmdir($filename); - - display_notification(_("Selected extension has been successfully deleted")); + unset($extensions[$id]); + if (update_extensions($extensions)) + display_notification(_("Selected extension has been successfully deleted")); return true; } -- 2.30.2