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 <[email protected]>
This commit is contained in:
frommeandClaude Opus 5.5 committed 2026-10-21 17:28:11 +02:00
1 parent 00034c99ae
commit fc98dc7d37
1 file changed
+11 -11
@@ -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 => [],