fix: render product detail pages on TYPO3 13

- ObjectManager replaced by GeneralUtility::makeInstance(), the
  services fetched that way are public
- QueryBuilder::add('orderBy') and the remaining execute() calls,
  detailAction returns a response
- PHP 8 warnings for missing array keys (same values as on PHP 7.4)
- Webcam images are external URLs: plain img tag, f:image only takes
  FAL files
- typo3_encore 7 needs the PKG:ssch/typo3-encore: prefix and
  external = 1 so TYPO3's path check does not drop the entry
- CDN image rewriting as a middleware instead of EXT:replacer, which
  is not PHP 8.5 clean; same pattern, only for page responses
- vhs 8 for the ViewHelpers the templates use
- OpenGraph meta tag manager skips the backend
- myEpUrl with trailing slash as in production

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
frommeandClaude Opus 5.5 committed 2026-10-21 14:34:10 +02:00
1 parent 4eb1de2e29
commit 34f2d55f2c
23 files changed
+222 -57

No files matched your search

@@ -65,7 +65,7 @@ class RecordFinder
$rows = [];
foreach ($queryBuilder->execute()->fetchAllAssociative() as $row) {
foreach ($queryBuilder->executeQuery()->fetchAllAssociative() as $row) {
$rows[(int) $row['uid']] = $row;
}
@@ -127,7 +127,7 @@ class ProductController extends ActionController
?Hotel $hotel = null,
$dateFrom = null,
$dateTo = null
) {
): ResponseInterface {
// Get product to display from flexform settings if not provided via url
if ($product === null) {
$productUid = $this->settings['productUid'];
@@ -175,7 +175,7 @@ class ProductController extends ActionController
// Assemble backlink
$backlinkUrl = $this->request->getQueryParams()['ref'] ?? null;
$backLinkLabel = strpos($backlinkUrl, 'suche') !== -1 ? 'zurück zum Suchergebnis' : 'zurück';
$backLinkLabel = strpos((string)$backlinkUrl, 'suche') !== -1 ? 'zurück zum Suchergebnis' : 'zurück';
$this->view->assignMultiple([
'hotel' => $hotel,
@@ -193,6 +193,7 @@ class ProductController extends ActionController
'nonBookableInfo' => $nonBookableInfo,
'pickupsOverview' => $this->pickupOverviewService->getOverview($product, $hotel),
]);
return $this->htmlResponse();
}
public function pricetableAction(): ResponseInterface
@@ -9,6 +9,7 @@ use EP\EpProducts\Service\FilterService;
use EP\EpProducts\Traits\DbConnectionTrait;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
use TYPO3\CMS\Extbase\Persistence\Repository;
@@ -18,8 +19,7 @@ abstract class AbstractRepository extends Repository
public function initializeObject(): void
{
/** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
$querySettings = $this->objectManager->get(Typo3QuerySettings::class);
$querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
@@ -94,7 +94,7 @@ class HotelRepository extends AbstractRepository
->setParameter('productUid', $productUid)
;
return $qb->execute()->fetchAllAssociative();
return $qb->executeQuery()->fetchAllAssociative();
}
/**
@@ -146,7 +146,7 @@ class HotelRepository extends AbstractRepository
;
}
return $qb->execute()->fetchAllAssociative();
return $qb->executeQuery()->fetchAllAssociative();
}
/**
@@ -174,9 +174,10 @@ class HotelRepository extends AbstractRepository
->leftJoin('hotel', 'tx_epproducts_domain_model_country', 'country', 'hotel.country = country.uid')
->leftJoin('hotel', 'tx_epproducts_domain_model_region', 'region', 'hotel.region = region.uid')
->where('hotel.show_as_teaser = 1')
->add('orderBy', 'FIELD(hotel.type, ' . Hotel::TYPE_SPORTS_CLUB . ') DESC')
->addOrderBy('hotel.name', 'ASC')
;
// Raw expression: TYPO3's orderBy() would quote it as an identifier
$qb->getConcreteQueryBuilder()->orderBy('FIELD(hotel.type, ' . Hotel::TYPE_SPORTS_CLUB . ') DESC');
$qb->addOrderBy('hotel.name', 'ASC');
if ($excludedHotelUids) {
$qb
@@ -216,7 +217,7 @@ class HotelRepository extends AbstractRepository
;
}
return $qb->execute()->fetchAllAssociative();
return $qb->executeQuery()->fetchAllAssociative();
}
/**
@@ -244,8 +245,9 @@ class HotelRepository extends AbstractRepository
->addGroupBy('date.hotel')
->addGroupBy('date.date_start')
->addGroupBy('date.nights')
->add('orderBy', 'FIELD(date.hotel_type, ' . Hotel::TYPE_SPORTS_CLUB . ') DESC')
;
// Raw expression: TYPO3's orderBy() would quote it as an identifier
$qb->getConcreteQueryBuilder()->orderBy('FIELD(date.hotel_type, ' . Hotel::TYPE_SPORTS_CLUB . ') DESC');
if ($excludeNonSearchable) {
$qb->where('date.product_searchable = 1');
@@ -104,7 +104,7 @@ class ProductRepository extends AbstractRepository
);
}
if ($filterSettings['productsPid']) {
if (!empty($filterSettings['productsPid'])) {
$productsPid = $filterSettings['productsPid'];
$qb->andWhere($qb->expr()->in(
'date.product_pid',
@@ -157,7 +157,7 @@ class ProductRepository extends AbstractRepository
->addOrderBy('date.date_start')
;
if ($filterSettings['productsPid']) {
if (!empty($filterSettings['productsPid'])) {
$productsPid = (array) $filterSettings['productsPid'];
$qb->andWhere($qb->expr()->in(
'date.product_pid',
@@ -236,7 +236,7 @@ class ProductRepository extends AbstractRepository
)
;
if ($filterSettings['productsPid']) {
if (!empty($filterSettings['productsPid'])) {
$productsPid = (array) $filterSettings['productsPid'];
$qb->andWhere($qb->expr()->in(
'date.product_pid',
@@ -294,7 +294,7 @@ class ProductRepository extends AbstractRepository
->groupBy('date.date_start')
;
if ($filterSettings['productsPid']) {
if (!empty($filterSettings['productsPid'])) {
$productsPid = (array) $filterSettings['productsPid'];
$qb->andWhere($qb->expr()->in(
'date.product_pid',
@@ -108,7 +108,7 @@ abstract class AbstractImageService implements SingletonInterface
{
$cropString = $image->getProperty('crop');
$cropVariantCollection = CropVariantCollection::create((string) $cropString);
$cropVariant = $processingInstructions['cropVariant'] ?: 'default';
$cropVariant = ($processingInstructions['cropVariant'] ?? null) ?: 'default';
$cropArea = $cropVariantCollection->getCropArea($cropVariant);
return $cropArea->isEmpty() ? null : $cropArea->makeAbsoluteBasedOnFile($image);
@@ -82,8 +82,8 @@ class HotelDataService implements SingletonInterface
$hotelCategory = array_key_exists($hotelData['hotelCategory'], Hotel::$categoryLabels) ?
Hotel::$categoryLabels[$hotelData['hotelCategory']] : null;
$dateStart = new \DateTime($hotelData['dateStart']);
$dateEnd = new \DateTime($hotelData['dateEnd']);
$dateStart = new \DateTime($hotelData['dateStart'] ?? 'now');
$dateEnd = new \DateTime($hotelData['dateEnd'] ?? 'now');
return [
'minDateStart' => $dateStart,
@@ -5,18 +5,15 @@ namespace EP\EpProducts\Traits;
use EP\EpProducts\Service\FilterService;
use EP\EpProducts\Service\SearchResultService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
trait RequestArgumentTypeConversionTrait
{
public function processSearchParamsArgument(): void
{
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var SearchResultService $searchResultService */
$searchResultService = $objectManager->get(SearchResultService::class);
$searchResultService = GeneralUtility::makeInstance(SearchResultService::class);
if (!$this->request->hasArgument('searchParams')) {
$searchParams = $searchResultService->getNormalizedSearchParams();
@@ -32,11 +29,9 @@ trait RequestArgumentTypeConversionTrait
public function processFilterSettingsArgument(array $forcedConceptUids = []): void
{
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var FilterService $filterService */
$filterService = $objectManager->get(FilterService::class);
$filterService = GeneralUtility::makeInstance(FilterService::class);
if (!$this->request->hasArgument('filterSettings')) {
$filterSettings = $filterService->getNormalizedFilterSettings([], $forcedConceptUids);
@@ -29,7 +29,6 @@ namespace EP\EpProducts\Utility;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Extbase\Service\ImageService;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@@ -97,9 +96,7 @@ class SerializationUtility
protected static function getImageService()
{
if (static::$imageService === null) {
/** @var ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
static::$imageService = $objectManager->get(ImageService::class);
static::$imageService = GeneralUtility::makeInstance(ImageService::class);
}
return static::$imageService;
@@ -30,7 +30,6 @@ namespace EP\EpProducts\Utility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager;
class SettingsUtility
{
@@ -41,9 +40,7 @@ class SettingsUtility
public function __construct()
{
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$configurationManager = $objectManager->get(ConfigurationManager::class);
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$settings = GeneralUtility::removeDotsFromTS(
$configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
);
@@ -11,6 +11,26 @@ services:
EP\EpProducts\Service\ProductImportSource:
alias: EP\EpProducts\Service\ApiImportSource
# Fetched with GeneralUtility::makeInstance() by data processors, view helpers and utilities
EP\EpProducts\Domain\Repository\CityRepository:
public: true
EP\EpProducts\Domain\Repository\ConceptRepository:
public: true
EP\EpProducts\Domain\Repository\CountryRepository:
public: true
EP\EpProducts\Domain\Repository\RegionRepository:
public: true
EP\EpProducts\Service\FilterService:
public: true
EP\EpProducts\Service\HotelDataService:
public: true
EP\EpProducts\Service\ProductDataService:
public: true
EP\EpProducts\Service\ResellerDataService:
public: true
EP\EpProducts\Service\SearchResultService:
public: true
cache.ep_cache:
class: TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
public: true