Skip to content

Commit

Permalink
Merge pull request #13 from ArjenMiedema/fix-error-with-new-guest-det…
Browse files Browse the repository at this point in the history
…ails

Fix issue with new guest details section
  • Loading branch information
Tjitse-E committed May 9, 2024
2 parents a35a0f5 + 2fe91fe commit 703bc56
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 703bc56

Please sign in to comment.