From a34564fc09f0b37d6f60432d747d2c19011bb649 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Wed, 16 May 2012 13:31:44 +0000 Subject: [PATCH] [-] BO : fix #PSCFV-2377 - missing JS files when saving product with errors --- classes/controller/Controller.php | 6 +++--- controllers/admin/AdminProductsController.php | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/classes/controller/Controller.php b/classes/controller/Controller.php index 494167fad..9f59dca64 100644 --- a/classes/controller/Controller.php +++ b/classes/controller/Controller.php @@ -150,9 +150,6 @@ abstract class ControllerCore $this->init(); if ($this->checkAccess()) { - if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) - $this->setMedia(); - // postProcess handles ajaxProcess $this->postProcess(); @@ -160,7 +157,10 @@ abstract class ControllerCore $this->redirect(); if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) + { + $this->setMedia(); $this->initHeader(); + } if ($this->viewAccess()) $this->initContent(); diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index f6bb4faa6..94ca65b6e 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1413,7 +1413,10 @@ class AdminProductsControllerCore extends AdminController $this->checkProduct(); if (!empty($this->errors)) + { + $this->display = 'add'; return false; + } $this->object = new $this->className(); $this->_removeTaxFromEcotax(); @@ -1503,7 +1506,7 @@ class AdminProductsControllerCore extends AdminController if (!empty($this->errors)) { - //$this->display = 'edit'; + $this->display = 'edit'; return false; } @@ -3942,7 +3945,6 @@ class AdminProductsControllerCore extends AdminController _PS_JS_DIR_.'jquery/plugins/treeview-categories/jquery.treeview-categories.css', _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css', )); - } }