From 95613879c5098358d8d6f1d70cf48ab5bdcb8d71 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 23 May 2022 08:27:25 +0530 Subject: [PATCH 1/2] Fix wrong search results page url causing SQL error --- controllers/front/CategoryController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index dccf500f8..5b8a2f254 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -104,7 +104,7 @@ class CategoryControllerCore extends FrontController if (!$this->category->active || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')))) { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); - $this->errors[] = Tools::displayError('Category not found'); + Tools::redirect('index.php?controller=404'); } else // Check if category can be accessible by current customer and return 403 if not if (!$this->category->checkAccess($this->context->customer->id)) { From 0230de6159585a13bba12dc9decc3a0b4f601f71 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 28 Jun 2022 11:42:48 +0530 Subject: [PATCH 2/2] updated link generation for not found page --- controllers/front/CategoryController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 5b8a2f254..424e2fb2b 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -104,7 +104,7 @@ class CategoryControllerCore extends FrontController if (!$this->category->active || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')))) { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); - Tools::redirect('index.php?controller=404'); + Tools::redirect($this->context->link->getPageLink('pagenotfound')); } else // Check if category can be accessible by current customer and return 403 if not if (!$this->category->checkAccess($this->context->customer->id)) {