Merge pull request #758 from abhishek-webkul/gli-777
Redirect to Page not found for invalid search results page URL
This commit is contained in:
@@ -211,7 +211,7 @@ class CategoryControllerCore extends FrontController
|
||||
'order_date_restrict' => $order_date_restrict
|
||||
));
|
||||
} else {
|
||||
Tools::redirect($this->context->link->getPageLink('index'));
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
}
|
||||
|
||||
$feat_img_dir = _PS_IMG_.'rf/';
|
||||
|
||||
@@ -64,7 +64,9 @@ class wkhotelfilterblock extends Module
|
||||
if ($this->context->controller->php_self == 'category') {
|
||||
|
||||
$htl_id_category = Tools::getValue('id_category');
|
||||
if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) {
|
||||
if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))
|
||||
&& ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category))
|
||||
) {
|
||||
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
|
||||
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true)));
|
||||
|
||||
@@ -73,8 +75,6 @@ class wkhotelfilterblock extends Module
|
||||
$id_lang = $this->context->language->id;
|
||||
$all_feat = FeatureCore::getFeatures($id_lang);
|
||||
|
||||
$id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category);
|
||||
|
||||
$max_adult = HotelRoomType::getMaxAdults($id_hotel);
|
||||
$max_child = HotelRoomType::getMaxChild($id_hotel);
|
||||
|
||||
|
||||
@@ -124,7 +124,9 @@ class WkRoomSearchBlock extends Module
|
||||
{
|
||||
if ('category' == Tools::getValue('controller')) {
|
||||
$idCategory = Tools::getValue('id_category');
|
||||
if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory))) {
|
||||
if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory))
|
||||
&& HotelBranchInformation::getHotelIdByIdCategory($idCategory)
|
||||
) {
|
||||
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
|
||||
$objSearchHelper = new WkRoomSearchHelper();
|
||||
$objSearchHelper->assignSearchPanelVariables();
|
||||
|
||||
Reference in New Issue
Block a user