From 58100276a68469aaa72ef63ac28c51dff751c152 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Wed, 9 Jan 2013 11:37:02 +0100 Subject: [PATCH] [-] BO : fixed bug #PSCFV-4668 - added check if module folder is writable before upgrade it --- controllers/admin/AdminModulesController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 9f6d883ec..5e1c141c3 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -528,11 +528,17 @@ class AdminModulesControllerCore extends AdminController if ($modules) foreach ($modules as $name) { - if ($key == 'update') + $full_report = null; + if ($key == 'update' && !ConfigurationTest::test_dir('modules/'.$name, true, $full_report)) + { + $module = Module::getInstanceByName(urldecode($name)); + $this->errors[] = $this->l(sprintf("Module %s can't be upgraded : ", $module->displayName)).$full_report; + } + else Tools::deleteDirectory('../modules/'.$name.'/'); // If Addons module, download and unzip it before installing it - if (!is_dir('../modules/'.$name.'/')) + if (!is_null($full_report) && !is_dir('../modules/'.$name.'/')) { $filesList = array( array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0),