Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #60 from SamNewism/master
Browse files Browse the repository at this point in the history
fix issue caused by expecting field to be called address
  • Loading branch information
leevigraham authored Jul 31, 2020
2 parents 95478a6 + a32808b commit 08ae7b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/assetbundles/addressfield/dist/js/Address.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
'CRAFT_CSRF_TOKEN': Craft.cp.$primaryForm.find('[name="CRAFT_CSRF_TOKEN"]').val(),
'countryCode': this.currentCountryCode,
'namespace': this.options.namespace,
'handle': this.options.id,
},
$.proxy(function (response, textStatus) {
this.$spinner.addClass('hidden');
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/AddressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function actionRefreshCountry(): Response
{
$this->requireAcceptsJson();

$address = Craft::$app->fields->getFieldByHandle('address');
$address = Craft::$app->fields->getFieldByHandle(Craft::$app->request->post('handle'));

$addressModel = new AddressModel([
'countryCode' => Craft::$app->request->post('countryCode')
Expand Down
39 changes: 11 additions & 28 deletions src/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 08ae7b3

Please sign in to comment.