From 3ea14ea72b20a0cc61e44f6fa8ca98bf4d883eaa Mon Sep 17 00:00:00 2001 From: fSerny Date: Thu, 17 May 2012 00:07:03 +0000 Subject: [PATCH] [-] BO : Fix scroll when errors occurred on modules --- admin-dev/themes/default/template/controllers/modules/js.tpl | 2 +- controllers/admin/AdminModulesController.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/modules/js.tpl b/admin-dev/themes/default/template/controllers/modules/js.tpl index 91d5c85ce..aa6d62c31 100644 --- a/admin-dev/themes/default/template/controllers/modules/js.tpl +++ b/admin-dev/themes/default/template/controllers/modules/js.tpl @@ -38,7 +38,7 @@ var by = '{l s='by'}'; var errorLogin = '{l s='PrestaShop was unable to login to Addons, please check your credentials and your internet connection.'}'; var confirmPreferencesSaved = '{l s='Preferences saved'}'; - {if isset($smarty.get.anchor)}var anchor = '{$smarty.get.anchor|htmlentities|replace:'(':''|replace:')':''|replace:'{':''|replace:'}':''|replace:'\'':''|replace:'/':''}';{else}var anchor = '';{/if} + {if isset($smarty.get.anchor) && !isset($error_module)}var anchor = '{$smarty.get.anchor|htmlentities|replace:'(':''|replace:')':''|replace:'{':''|replace:'}':''|replace:'\'':''|replace:'/':''}';{else}var anchor = '';{/if} {literal} diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 173b3dd0a..868da1ed5 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -771,6 +771,7 @@ class AdminModulesControllerCore extends AdminController // If error during module installation, no redirection $html_error = $this->generateHtmlMessage($module_errors); $this->errors[] = sprintf(Tools::displayError('The following module(s) were not installed properly: %s'), $html_error); + $this->context->smarty->assign('error_module', 'true'); } } if ($return)