diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/AjaxDateController.php b/web/typo3conf/ext/ep_products/Classes/Controller/AjaxDateController.php index 2796d69b..1e8634a9 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/AjaxDateController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/AjaxDateController.php @@ -35,7 +35,9 @@ use EP\EpProducts\Service\DateService; use EP\EpProducts\Service\FilterService; use EP\EpProducts\Service\ResellerService; use EP\EpProducts\Traits\RequestArgumentTypeConversionTrait; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; +use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; class AjaxDateController extends ActionController { @@ -115,12 +117,13 @@ class AjaxDateController extends ActionController if ($product->getAltProduct()) { $altProduct = $product->getAltProduct(); if ($this->productRepository->hasDates($altProduct)) { - $altProductLink = $this->uriBuilder - ->reset() - ->setTargetPageUid($altProduct->getDetailPage()) - ->setCreateAbsoluteUri(true) - ->build() - ; + /** @var ContentObjectRenderer $contentObject */ + $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); + $altProductLink = $contentObject->typoLink_URL( + [ + 'parameter' => $altProduct->getDetailPage(), + ] + ); $altLabel = $product->getAltLabel(); } } diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php b/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php index b28ff5f5..f9c5d7b9 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php @@ -33,6 +33,7 @@ use EP\EpProducts\Domain\Repository\ProductRepository; use EP\EpProducts\Service\HotelService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; +use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; class MapController extends ActionController { @@ -112,11 +113,12 @@ class MapController extends ActionController */ protected function getUriForPageUid($pageUid) { - return $this->uriBuilder - ->reset() - ->setTargetPageUid($pageUid) - ->setCreateAbsoluteUri(true) - ->build() - ; + /** @var ContentObjectRenderer $contentObject */ + $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); + return $contentObject->typoLink_URL( + [ + 'parameter' => $pageUid, + ] + ); } } diff --git a/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php b/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php index 9a5ae270..42e53e2d 100644 --- a/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php +++ b/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php @@ -70,7 +70,7 @@ class SearchResultUrlService implements SingletonInterface { foreach ($conceptData['items'] as $key => $item) { - $detailPageUid = $item['product']['detailPage'] ?: $defaultDetailPageUid; + $detailPageUid = $this->getProductPageUid($item['product']['detailPage'], $defaultDetailPageUid); $arguments = [ 'product' => $item['product']['uid'], 'hotel' => $item['hotel']['uid'], @@ -90,4 +90,23 @@ class SearchResultUrlService implements SingletonInterface $searchResult->setData($data); } + + /** + * @param mixed $uid + * @param int $defaultUid + * @return int + */ + protected function getProductPageUid($uid, $defaultUid) + { + if (is_numeric($uid)) { + return $uid; + } + + if (strpos($uid, 't3://') !== false) { + parse_str(parse_url($uid, PHP_URL_QUERY), $arguments); + return $arguments['uid']; + } + + return $defaultUid; + } } diff --git a/web/typo3conf/ext/ep_products/ext_tables.sql b/web/typo3conf/ext/ep_products/ext_tables.sql index cd7c4290..b15f2c37 100644 --- a/web/typo3conf/ext/ep_products/ext_tables.sql +++ b/web/typo3conf/ext/ep_products/ext_tables.sql @@ -17,7 +17,7 @@ CREATE TABLE tx_epproducts_domain_model_product ( code varchar(255) DEFAULT '' NOT NULL, feature varchar(255) DEFAULT '' NOT NULL, bus_pro_id int(11) unsigned NOT NULL default '0', - detail_page int(11) unsigned NOT NULL default '0', + detail_page varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, teaser text NOT NULL, teaser_long text NOT NULL, @@ -116,7 +116,7 @@ CREATE TABLE tx_epproducts_domain_model_date ( product_subline varchar(255) DEFAULT '' NOT NULL, product_fact varchar(255) DEFAULT '' NOT NULL, product_searchable tinyint(4) unsigned DEFAULT '0' NOT NULL, - product_detail_page int(11) unsigned NOT NULL default '0', + product_detail_page varchar(255) DEFAULT '' NOT NULL, product_keywords text NOT NULL, product_teaser text NOT NULL, product_feature varchar(255) DEFAULT '' NOT NULL, @@ -144,7 +144,7 @@ CREATE TABLE tx_epproducts_domain_model_date ( hotel_type tinyint(4) unsigned DEFAULT '0' NOT NULL, hotel_keywords text NOT NULL, hotel_teaser text NOT NULL, - hotel_detail_page int(11) unsigned NOT NULL default '0', + hotel_detail_page varchar(255) DEFAULT '' NOT NULL, earlybird tinyint(4) unsigned DEFAULT '0' NOT NULL, low_contingent tinyint(4) unsigned DEFAULT '0' NOT NULL, rooms int(11) unsigned DEFAULT '0', @@ -191,7 +191,7 @@ CREATE TABLE tx_epproducts_domain_model_hotel ( earlybird tinyint(4) unsigned DEFAULT '0' NOT NULL, low_contingent tinyint(4) unsigned DEFAULT '0' NOT NULL, show_as_teaser tinyint(4) unsigned DEFAULT '0' NOT NULL, - detail_page int(11) unsigned NOT NULL default '0', + detail_page varchar(255) DEFAULT '' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, headline varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, @@ -356,7 +356,7 @@ CREATE TABLE tx_epproducts_domain_model_concept ( code varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, description_extended text NOT NULL, - detail_page int(11) DEFAULT '0' NOT NULL, + detail_page varchar(255) DEFAULT '' NOT NULL, products int(11) DEFAULT '0' NOT NULL, teaser text NOT NULL, headline varchar(255) DEFAULT '' NOT NULL, @@ -402,7 +402,7 @@ CREATE TABLE tx_epproducts_domain_model_country ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, - detail_page int(11) unsigned NOT NULL default '0', + detail_page varchar(255) DEFAULT '' NOT NULL, code char(2) DEFAULT '' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, name_internal varchar(255) DEFAULT '' NOT NULL, @@ -460,7 +460,7 @@ CREATE TABLE tx_epproducts_domain_model_region ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, - detail_page int(11) unsigned NOT NULL default '0', + detail_page varchar(255) DEFAULT '' NOT NULL, exclude_from_teasergroups tinyint(4) unsigned DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, name_internal varchar(255) DEFAULT '' NOT NULL, @@ -534,7 +534,7 @@ CREATE TABLE tx_epproducts_domain_model_city ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, - detail_page int(11) unsigned NOT NULL default '0', + detail_page varchar(255) DEFAULT '' NOT NULL, exclude_from_teasergroups tinyint(4) unsigned DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, name_internal varchar(255) DEFAULT '' NOT NULL, diff --git a/web/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php b/web/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php index ca7b388f..e49c02a2 100644 --- a/web/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php +++ b/web/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php @@ -29,7 +29,9 @@ namespace EP\EpTheme\ViewHelpers\Uri; use EP\EpProducts\Domain\Model\Hotel; use EP\EpProducts\Domain\Model\Product; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper; +use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; @@ -62,14 +64,15 @@ class ProductViewHelper extends AbstractViewHelper ) { $product = $arguments['product']; + if ($product->getDetailPage()) { - return $renderingContext - ->getControllerContext() - ->getUriBuilder() - ->reset() - ->setTargetPageUid($product->getDetailPage()) - ->build() - ; + /** @var ContentObjectRenderer $contentObject */ + $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); + return $contentObject->typoLink_URL( + [ + 'parameter' => $product->getDetailPage(), + ] + ); } $pageUid = $arguments['defaultDetailPageUid']; diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Breadcrumb.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Breadcrumb.html index 68598d50..77f5f6d8 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Breadcrumb.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Breadcrumb.html @@ -7,7 +7,7 @@ {item.title -> v:format.replace(substring: '#', replacement: ' ')} - {item.title -> v:format.replace(substring: '#', replacement: ' ')} + {item.title -> v:format.replace(substring: '#', replacement: ' ')} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html index fdc10091..5551d6db 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html @@ -5,7 +5,7 @@ xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> - + f:format.crop(maxCharacters: settings.teaserTextMaxChars) -> f:format.html()} {f:translate(key: 'tx_eptheme.label.teaserbutton.default', extensionName: 'ep_theme')} - +