Skip to content

Commit

Permalink
Fix issue with new guest details section
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ArjenMiedema committed Feb 15, 2024
1 parent a35a0f5 commit 2fe91fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Model/Form/Modifier/AddHousenumberFieldValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit 2fe91fe

Please sign in to comment.