From 3d0a1d86e6d9debf63c21510275dd648077e9ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 5 Jul 2023 15:50:40 +0200 Subject: [PATCH] Fix: Don't append paCode when null --- .../ext/ep_products/Classes/Utility/BookingUrlUtility.php | 2 +- .../Assets/js/controllers/product_details_controller.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Utility/BookingUrlUtility.php b/public/typo3conf/ext/ep_products/Classes/Utility/BookingUrlUtility.php index 84aba729..7eb5bed8 100644 --- a/public/typo3conf/ext/ep_products/Classes/Utility/BookingUrlUtility.php +++ b/public/typo3conf/ext/ep_products/Classes/Utility/BookingUrlUtility.php @@ -71,7 +71,7 @@ class BookingUrlUtility } } - if ($paCode) { + if (null !== $paCode) { $query['agenturcode'] = $paCode; } elseif ($bpnCookie) { $query['agenturcode'] = $bpnCookie; diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/product_details_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/product_details_controller.js index 793c8cf1..0c8b4d32 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/product_details_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/product_details_controller.js @@ -53,7 +53,9 @@ export default class extends Controller { this.loadingValue = true let paCode = this.getConfig().paCode const data = new URLSearchParams() - data.append('pa', paCode) + if (null !== paCode) { + data.append('pa', paCode) + } this.datesTableContainerTarget.innerHTML = '' fetch(`${this.datestableUriValue}&${data}`) .then(this.checkStatus) @@ -73,7 +75,9 @@ export default class extends Controller { this.modeValue = 'prices' let paCode = this.getConfig().paCode const data = new URLSearchParams() - data.append('pa', paCode) + if (null !== paCode) { + data.append('pa', paCode) + } fetch(`${params.pricesUrl}&${data}`) .then(this.checkStatus) .then(this.parseHTML)