Skip to content

Commit

Permalink
Fixed a bug where installing the plugin could fail if the plugin had …
Browse files Browse the repository at this point in the history
…been installed and uninstalled before.

Resolve #92
  • Loading branch information
andris-sevcenko committed Jul 23, 2020
1 parent c3f5f98 commit a8b3521
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed
- Fixed a bug where focal point detection would not work if aliases were used in the subfolder setting. ([#86](https://github.com/craftcms/aws-s3/pull/86))
- Fixed a bug where installing the plugin could fail if the plugin had been installed and uninstalled before. ([#92](https://github.com/craftcms/aws-s3/issues/92))

## 1.2.8 - 2020-05-18

Expand Down
5 changes: 5 additions & 0 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ private function _convertVolumes()
if ($volume['type'] === Volume::class && isset($volume['settings']) && is_array($volume['settings'])) {
$settings = $volume['settings'];

// This is not a legacy S3 volume
if (empty($volume['location'])) {
continue;
}

$hasUrls = !empty($volume['hasUrls']);
$url = ($hasUrls && !empty($settings['urlPrefix'])) ? $settings['urlPrefix'] : null;
$settings['region'] = $settings['location'];
Expand Down

0 comments on commit a8b3521

Please sign in to comment.