Skip to content

Commit

Permalink
FIxed #96
Browse files Browse the repository at this point in the history
- Fixed a bug where SimpleMap would cause the `ResaveElements` job to error when triggered via console.
  • Loading branch information
Tam committed Mar 13, 2018
1 parent 64c4352 commit d7c951e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.3.3 - 2018-03-13
### Fixed
- Fixed a bug where SimpleMap would cause the `ResaveElements` job to error when triggered via console.

## 3.3.2 - 2018-03-05
### Added
- Added docs for using a config file to configure the plugin.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ether/simplemap",
"description": "A beautifully simple Google Map field type.",
"version": "3.3.2",
"version": "3.3.3",
"type": "craft-plugin",
"license": "MIT",
"minimum-stability": "dev",
Expand Down
6 changes: 5 additions & 1 deletion src/services/MapService.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ public function getField (MapField $field, ElementInterface $owner, $value): Map
]
);

if (\Craft::$app->request->getIsPost() && $value) {
if (
!\Craft::$app->request->isConsoleRequest
&& \Craft::$app->request->isPost
&& $value
) {
$model = new Map($value);
} else if ($record) {
$model = new Map($record->getAttributes());
Expand Down

0 comments on commit d7c951e

Please sign in to comment.