Skip to content

Commit

Permalink
- Fixed bug on default country and hide country setting not getting c…
Browse files Browse the repository at this point in the history
…orrect behavior. #63
  • Loading branch information
pdaleramirez committed Sep 12, 2018
1 parent cd29360 commit 28e9aac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fields/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getInputHtml($value, ElementInterface $element = null): string

$addressInfoModel = SproutBase::$app->addressField->getAddressById($addressId);

$countryCode = $addressInfoModel->countryCode;
$countryCode = $addressInfoModel->countryCode ?? $defaultCountryCode;

$this->addressHelper->setParams($countryCode, $name, $addressInfoModel);

Expand All @@ -125,7 +125,7 @@ public function getInputHtml($value, ElementInterface $element = null): string
$addressFormat = $this->addressHelper->getAddressWithFormat($addressInfoModel);
}

$countryInput = $this->addressHelper->countryInput();
$countryInput = $this->addressHelper->countryInput($hideCountryDropdown);
$addressForm = $this->addressHelper->getAddressFormHtml();

return Craft::$app->getView()->renderTemplate(
Expand Down

0 comments on commit 28e9aac

Please sign in to comment.