Redirect to search page on empty url argument
This commit is contained in:
@@ -33,6 +33,7 @@ use EP\EpProducts\Domain\Repository\HotelRepository;
|
|||||||
use EP\EpProducts\Domain\Repository\ProductRepository;
|
use EP\EpProducts\Domain\Repository\ProductRepository;
|
||||||
use EP\EpProducts\Service\DateService;
|
use EP\EpProducts\Service\DateService;
|
||||||
use EP\EpProducts\Service\FilterService;
|
use EP\EpProducts\Service\FilterService;
|
||||||
|
use EP\EpProducts\Service\FilterSettingsEncoder;
|
||||||
use EP\EpProducts\Service\HotelDataService;
|
use EP\EpProducts\Service\HotelDataService;
|
||||||
use EP\EpProducts\Service\ProductDataService;
|
use EP\EpProducts\Service\ProductDataService;
|
||||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
@@ -113,7 +114,15 @@ class ProductController extends ActionController
|
|||||||
}
|
}
|
||||||
// Redirect to search page in case no product can be determined
|
// Redirect to search page in case no product can be determined
|
||||||
if ($product === null) {
|
if ($product === null) {
|
||||||
$this->redirect('search', 'Search', null, null, $this->settings['defaultSearchPageUid']);
|
$filterSettings = $this->filterService->getDefaultFilterSettings();
|
||||||
|
$filterSettingsEncoded = FilterSettingsEncoder::encode($filterSettings);
|
||||||
|
$this->redirect(
|
||||||
|
'searchresult',
|
||||||
|
'Search',
|
||||||
|
null,
|
||||||
|
['filterSettings' => $filterSettingsEncoded],
|
||||||
|
$this->settings['defaultSearchPageUid']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// Get hotel to display from flexform settings if not provided via url
|
// Get hotel to display from flexform settings if not provided via url
|
||||||
if ((int)$this->settings['hotelUid'] > 0) {
|
if ((int)$this->settings['hotelUid'] > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user