From fc98dc7d3730833935c40d10abe2be5ed14975d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 21 Oct 2026 17:28:11 +0200 Subject: [PATCH] fix: optional table options default to what PHP 7.4 read DateService reads options that callers only sometimes pass (paCode, filterSettings, date, nonBookableDateUids, showBookingButton). Missing keys were null on PHP 7.4; in_array() on null returned a falsy value, so nonBookableDateUids defaults to an empty list. Fixes the event price table (500). All 216 distinct AJAX fragment URLs referenced from the TYPO3 10 pages (date and price tables, event price tables, concept popups, filter panel) were compared with TYPO3 10 on the same data: identical, apart from daytripRooms, which fails on both. Co-Authored-By: Claude Opus 5.5 --- .../Classes/Service/DateService.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/ep_products/Classes/Service/DateService.php b/packages/ep_products/Classes/Service/DateService.php index 52f4bf1..0746a7f 100644 --- a/packages/ep_products/Classes/Service/DateService.php +++ b/packages/ep_products/Classes/Service/DateService.php @@ -117,10 +117,10 @@ class DateService implements SingletonInterface /** @var Product $product */ $product = $resolvedOptions['product']; $hotel = $resolvedOptions['hotel']; - $filterSettings = $resolvedOptions['filterSettings']; - $date = $resolvedOptions['date']; + $filterSettings = $resolvedOptions['filterSettings'] ?? null; + $date = $resolvedOptions['date'] ?? null; $myEpUrl = $resolvedOptions['myEpUrl']; - $paCode = $resolvedOptions['paCode']; + $paCode = $resolvedOptions['paCode'] ?? null; if ($filterSettings === null) { $filterSettings = $this->filterService->getNormalizedFilterSettings(); @@ -160,7 +160,7 @@ class DateService implements SingletonInterface /** @var Product $product */ $product = $resolvedOptions['product']; $hotel = $resolvedOptions['hotel']; - $filterSettings = $resolvedOptions['filterSettings']; + $filterSettings = $resolvedOptions['filterSettings'] ?? null; if ($filterSettings === null) { $filterSettings = $this->filterService->getNormalizedFilterSettings(); @@ -204,11 +204,11 @@ class DateService implements SingletonInterface $priceTableData = $resolvedOptions['priceTableData']; $myEpUrl = $resolvedOptions['myEpUrl']; - $paCode = $resolvedOptions['paCode']; - $nonBookableDateUids = $resolvedOptions['nonBookableDateUids']; + $paCode = $resolvedOptions['paCode'] ?? null; + $nonBookableDateUids = $resolvedOptions['nonBookableDateUids'] ?? []; foreach ($priceTableData as $row) { - $showBookingButton = $resolvedOptions['showBookingButton'] && !in_array($row['dateBusProId'], $nonBookableDateUids); + $showBookingButton = ($resolvedOptions['showBookingButton'] ?? null) && !in_array($row['dateBusProId'], $nonBookableDateUids); $dateStart = new \DateTime($row['dateStart']); $dateEnd = new \DateTime($row['dateEnd']); @@ -290,12 +290,12 @@ class DateService implements SingletonInterface $dateTableData = $resolvedOptions['dateTableData']; $myEpUrl = $resolvedOptions['myEpUrl']; - $paCode = $resolvedOptions['paCode']; - $nonBookableDateUids = $resolvedOptions['nonBookableDateUids']; + $paCode = $resolvedOptions['paCode'] ?? null; + $nonBookableDateUids = $resolvedOptions['nonBookableDateUids'] ?? []; foreach ($dateTableData as $row) { // Default booking button status is determined by the product - $showBookingButton = $resolvedOptions['showBookingButton']; + $showBookingButton = ($resolvedOptions['showBookingButton'] ?? null); // Check if booking button is disabled for this date if (true === in_array($row['dateBusProId'], $nonBookableDateUids)) { $showBookingButton = false; @@ -349,7 +349,7 @@ class DateService implements SingletonInterface $priceTableData = $resolvedOptions['priceTableData']; $maxPax = $resolvedOptions['maxPax']; $myEpUrl = $resolvedOptions['myEpUrl']; - $paCode = $resolvedOptions['paCode']; + $paCode = $resolvedOptions['paCode'] ?? null; $priceTable = [ Hotel::CATEGORY_STANDARD => [],