From fea8f50ab987fa5f2e34a094d5bf982602fdf7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 21 Mar 2013 12:03:39 +0100 Subject: [PATCH] // reset category filter on adminproducts on multishop when category is not associated to the shop --- controllers/admin/AdminProductsController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 59dff18d1..b355d4d0b 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -126,6 +126,15 @@ class AdminProductsControllerCore extends AdminController if (Tools::getValue('reset_filter_category')) $this->context->cookie->id_category_products_filter = false; + if (Shop::isFeatureActive() && $this->context->cookie->id_category_products_filter) + { + $category = new Category((int)$this->context->cookie->id_category_products_filter); + if (!$category->inShop()) + { + $this->context->cookie->id_category_products_filter = false; + Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts')); + } + } /* Join categories table */ if ($id_category = (int)Tools::getValue('productFilter_cl!name')) {