Skip to content

Commit

Permalink
Fix double record save on Craft 2 > 3 upgrade
Browse files Browse the repository at this point in the history
Fixes #153
  • Loading branch information
Tam committed Apr 5, 2019
1 parent c7347f9 commit cea5a8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.4.11 - 2019-04-05
### Fixed
- Map records are no longer double saved when upgrading to from Craft 2 to 3

## 3.4.10 - 2019-04-04
### Fixed
- Map records are no longer double saved when upgrading to >3.4.x
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 Map field type for Craft CMS 3",
"version": "3.4.10",
"version": "3.4.11",
"type": "craft-plugin",
"license": "MIT",
"minimum-stability": "dev",
Expand Down
14 changes: 0 additions & 14 deletions src/migrations/m190226_143809_craft3_upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,6 @@ private function _upgrade2 ()
]);

$elements->saveElement($map, false);

$record = new Map();
$record->id = $map->id;
$record->ownerId = $map->ownerId;
$record->ownerSiteId = $map->ownerSiteId;
$record->fieldId = $map->fieldId;

$record->lat = $map->lat;
$record->lng = $map->lng;
$record->zoom = $map->zoom;
$record->address = $map->address;
$record->parts = $map->parts;

$record->save();
}

$this->dropTable('{{%simplemap_maps}}');
Expand Down

0 comments on commit cea5a8b

Please sign in to comment.