From 2fe91fe9a4854805f1bba2af0e839e16331f5803 Mon Sep 17 00:00:00 2001 From: Arjen Miedema Date: Thu, 15 Feb 2024 14:58:23 +0100 Subject: [PATCH] Fix issue with new guest details section The component was checking for a street field. For the new guest details section this isn't available. So for that reason an additional check has been added to skip further logic if there is no "street" field. --- Model/Form/Modifier/AddHousenumberFieldValidation.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Model/Form/Modifier/AddHousenumberFieldValidation.php b/Model/Form/Modifier/AddHousenumberFieldValidation.php index 86df650..4727fd7 100644 --- a/Model/Form/Modifier/AddHousenumberFieldValidation.php +++ b/Model/Form/Modifier/AddHousenumberFieldValidation.php @@ -5,6 +5,7 @@ namespace Vendic\HyvaCheckoutGoogleAddressAutocomplete\Model\Form\Modifier; +use Hyva\Checkout\Model\Form\EntityFormElementInterface; use Hyva\Checkout\Model\Form\EntityFormInterface; use Hyva\Checkout\Model\Form\EntityFormModifierInterface; @@ -26,6 +27,10 @@ public function apply(EntityFormInterface $form): EntityFormInterface function (EntityFormInterface $form) { $street = $form->getElement('street'); + if (!$street instanceof EntityFormElementInterface) { + return; + } + $relatives = $street->getRelatives(); // Check if there is only one relative, if not, we don't have a housenumber field