From d5945ec7fddd391df57fde255b60c08c7e2047a8 Mon Sep 17 00:00:00 2001 From: mBertholino Date: Mon, 26 Dec 2011 17:08:59 +0000 Subject: [PATCH] [-] BO : retrocompatibility with adminModuleController 1.4 => 1.5. Some modules use $_GET['tab'], on 1.5, those modules don't work because $_GET['tab'] doesn't exist. Now they work in the 1.5 even when they use $_GET['tab'] git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11773 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminModulesController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 5c6b0b642..218a6450a 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -526,7 +526,6 @@ class AdminModulesControllerCore extends AdminController } } - // Check potential error if (!($module = Module::getInstanceByName(urldecode($name)))) $this->_errors[] = $this->l('module not found'); @@ -545,6 +544,7 @@ class AdminModulesControllerCore extends AdminController // If we install a module, force temporary global context for multishop if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL) { + // If we install a module, force temporary global context for multishop if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && $method != 'getContent') { @@ -554,6 +554,10 @@ class AdminModulesControllerCore extends AdminController } } + //retrocompatibility + if (Tools::getValue('controller') != '') + $_POST['tab'] = Tools::safeOutput(Tools::getValue('controller')); + if (((method_exists($module, $method) && ($echo = $module->{$method}()))) AND $key == 'configure' AND Module::isInstalled($module->name)) { $backlink = self::$currentIndex.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name; @@ -593,7 +597,6 @@ class AdminModulesControllerCore extends AdminController Context::getContext()->shop = clone(Context::getContext()->tmpOldShop); unset(Context::getContext()->tmpOldShop); } - // Display module configuration $this->context->smarty->assign('module_content', $toolbar.'
 
'.$echo.'
 
'.$toolbar); } @@ -601,7 +604,6 @@ class AdminModulesControllerCore extends AdminController $return = ($method == 'install' ? 12 : 13); elseif ($echo === false) $module_errors[] = array('name' => $name, 'message' => $module->getErrors()); - if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop)) { Context::getContext()->shop = clone(Context::getContext()->tmpOldShop); @@ -926,7 +928,6 @@ class AdminModulesControllerCore extends AdminController if ($this->logged_on_addons) $tpl_vars['logged_on_addons'] = 1; - $smarty->assign($tpl_vars); }