Skip to content

Commit

Permalink
Changes for 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Aug 7, 2024
1 parent 6eb06bb commit b421c87
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Easy Address Field for Craft CMS

## 3.1.3 - 2024-08-07
### Fixed
- Further improvements to catching Nomanatim errors ([#37](https://github.com/studioespresso/craft-easyaddressfield/issues/37))

## 3.1.2 - 2024-08-01
### Fixed
- Fixed a crash when Nomanatim service isn't available ([#37](https://github.com/studioespresso/craft-easyaddressfield/issues/37))
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "studioespresso/craft-easyaddressfield",
"description": "The only address field you need",
"type": "craft-plugin",
"version": "3.1.2",
"version": "3.1.3",
"keywords": [
"cms",
"craftcms",
Expand Down
6 changes: 4 additions & 2 deletions src/services/FieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Craft;
use craft\base\Component;
use craft\base\ElementInterface;
use craft\helpers\ElementHelper;
use studioespresso\easyaddressfield\EasyAddressField;
use studioespresso\easyaddressfield\fields\EasyAddressFieldField;
use studioespresso\easyaddressfield\models\EasyAddressFieldModel;
Expand Down Expand Up @@ -40,8 +41,9 @@ public function saveField(EasyAddressFieldField $field, ElementInterface $elemen
$record->field = $field->id;
}

$value = EasyAddressField::$plugin->geolocation()->locate($value);

if(!ElementHelper::isDraftOrRevision($element) && $field->geoCode) {
$value = EasyAddressField::$plugin->geolocation()->locate($value);
}

$record->name = $value->name;
$record->street = $value->street;
Expand Down
1 change: 1 addition & 0 deletions src/services/GeoLocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function locate(EasyAddressFieldModel $model)
return $model;
} catch (\Throwable $e ){
Craft::error($e->getMessage(), __METHOD__);
return $model;
}
}

Expand Down

0 comments on commit b421c87

Please sign in to comment.