Merge branch 'feature/route-enhancing' into develop

This commit is contained in:
Björn Fromme
2020-02-21 09:23:19 +01:00
4 changed files with 84 additions and 29 deletions
+12 -2
View File
@@ -125,11 +125,15 @@ routeEnhancers:
type: PersistedAliasMapper
tableName: tx_epproducts_domain_model_hotel
routeFieldName: uid
date_from:
type: PassthroughMapper
date_to:
type: PassthroughMapper
requirements:
product_uid: '\d'
hotel_uid: '\d'
date_from: '\d{4}-\d{2}-\d{2}'
date_to: '\d{4}-\d{2}-\d{2}'
date_from: '\d{4}\-\d{2}\-\d{2}'
date_to: '\d{4}\-\d{2}\-\d{2}'
BookingLinkPlugin:
type: Extbase
extension: EpProducts
@@ -163,6 +167,9 @@ routeEnhancers:
defaultController: 'Search::searchresult'
requirements:
filter_settings: '[A-Z\d%\-]+'
aspects:
filter_settings:
type: PassthroughMapper
StaticResultsPlugin:
type: Extbase
extension: EpProducts
@@ -178,6 +185,9 @@ routeEnhancers:
defaultController: 'Search::staticresult'
requirements:
filter_settings: '[A-Z\d%\-]+'
aspects:
filter_settings:
type: PassthroughMapper
ContingentsIcalPlugin:
type: Extbase
extension: EpProducts
@@ -280,23 +280,23 @@ abstract class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Reposit
$this->addTransportationFilterConditions($query, $filterSettings);
// Default fulltext search in case autocompletion has not been used
if ((int) $filterSettings->getDestinationUid() === 0 && !empty($filterSettings->getDestinationName())) {
$query
->andWhere($query->expr()->orX(
$query->expr()->like('LOWER(date.country_name) COLLATE utf8_bin',':destination'),
$query->expr()->like('LOWER(date.country_keywords) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.region_name) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.region_keywords) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.city_name) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.city_keywords) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.hotel_name) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.hotel_keywords) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.product_name) COLLATE utf8_bin', ':destination'),
$query->expr()->like('LOWER(date.product_keywords) COLLATE utf8_bin', ':destination')
))
->setParameter('destination', '%' . mb_strtolower($filterSettings->getDestinationName()) . '%')
;
}
// if ((int) $filterSettings->getDestinationUid() === 0 && !empty($filterSettings->getDestinationName())) {
// $query
// ->andWhere($query->expr()->orX(
// $query->expr()->like('LOWER(date.country_name) COLLATE utf8_bin',':destination'),
// $query->expr()->like('LOWER(date.country_keywords) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.region_name) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.region_keywords) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.city_name) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.city_keywords) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.hotel_name) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.hotel_keywords) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.product_name) COLLATE utf8_bin', ':destination'),
// $query->expr()->like('LOWER(date.product_keywords) COLLATE utf8_bin', ':destination')
// ))
// ->setParameter('destination', '%' . mb_strtolower($filterSettings->getDestinationName()) . '%')
// ;
// }
// Product
if ((int) $filterSettings->getProductUid() > 0) {
@@ -0,0 +1,50 @@
<?php
namespace EP\EpProducts\Routing\Aspect;
/***************************************************************
*
* Copyright notice
*
* (c) 2020 Björn Fromme <[email protected]>, dreipunktnull
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Core\Routing\Aspect\StaticMappableAspectInterface;
class PassthroughMapper implements StaticMappableAspectInterface
{
/**
* @inheritDoc
*/
public function generate(string $value): ?string
{
return $value;
}
/**
* @inheritDoc
*/
public function resolve(string $value): ?string
{
return $value;
}
}
@@ -402,15 +402,9 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php'][
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'gclid';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'ref';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'pa';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_searchresult[searchParams]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_searchresult[filterSettings]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_product_detail[dateFrom]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_product_detail[dateTo]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_reseller[reseller]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[months]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[month]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[year]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[hotel]';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['PassthroughMapper'] =
\EP\EpProducts\Routing\Aspect\PassthroughMapper::class;
$GLOBALS['TYPO3_CONF_VARS']['LOG']['EP']['EpProducts']['Controller']['writerConfiguration'] = [
\TYPO3\CMS\Core\Log\LogLevel::INFO => [
@@ -420,4 +414,5 @@ $GLOBALS['TYPO3_CONF_VARS']['LOG']['EP']['EpProducts']['Controller']['writerConf
],
];
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['teamSlug'] = \EP\EpProducts\Updates\TeamSlugUpdater::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['teamSlug'] =
\EP\EpProducts\Updates\TeamSlugUpdater::class;