From a32808b6d74124041bf3e58ee434de9f7a3c8cdf Mon Sep 17 00:00:00 2001 From: Sam Leighton Date: Fri, 31 Jul 2020 16:46:13 +1000 Subject: [PATCH] fix issue caused by expecting field to be called address --- .../addressfield/dist/js/Address.js | 1 + src/controllers/AddressController.php | 2 +- src/icon.svg | 39 ++++++------------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/src/assetbundles/addressfield/dist/js/Address.js b/src/assetbundles/addressfield/dist/js/Address.js index 4b732bf..33f91b0 100644 --- a/src/assetbundles/addressfield/dist/js/Address.js +++ b/src/assetbundles/addressfield/dist/js/Address.js @@ -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'); diff --git a/src/controllers/AddressController.php b/src/controllers/AddressController.php index 38b7d6f..f76905d 100644 --- a/src/controllers/AddressController.php +++ b/src/controllers/AddressController.php @@ -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') diff --git a/src/icon.svg b/src/icon.svg index daf209a..6b36e8b 100644 --- a/src/icon.svg +++ b/src/icon.svg @@ -1,29 +1,12 @@ - - - - logo - Created with Sketch. - - - - + + + + + + + + + + +