Skip to content

Commit

Permalink
1.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hibberd authored and Sam Hibberd committed Feb 8, 2019
1 parent 62bd943 commit 3249793
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Linkit Changelog
> One link field to rule them all, built for [Craft 3](http://craftcms.com)
## 1.1.8 - 2019-02-04
## 1.1.8 - 2019-02-08

### Changed

* Changed migration scripts as per Crafts new recommendations
* Changed migration scripts as per Crafts new recommendations (Thanks to @andris)
* Changed requires Craft 3.1.2+
* Changed README.md installation instructions

## 1.1.7 - 2019-01-28

### Fixed

* Fixed README.md typos
* Fixed some README.md typos

### Added

* Added `{{ customText }}` info to the docs


## 1.1.6 - 2019-01-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
],
"require": {
"craftcms/cms": "^3.1.2"
"craftcms/cms": "^3.1.8"
},
"repositories": [
{
Expand Down
6 changes: 3 additions & 3 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ private function _upgradeFromCraft2()
case 'fruitlinkit':
case 'fruit-link-it':
case 'fruit-linkit':
$this->delete('{{%plugins}}', ['handle' => $pluginHandle]);
$projectConfig->remove(Plugins::CONFIG_PLUGINS_KEY . '.' . $pluginHandle);
break;
}
}

$this->delete('{{%plugins}}', ['handle' => ['fruitlinkit', 'fruit-linkit', 'fruit-link-it']]);

// Get the field data from the project config
$fields = $projectConfig->get(Fields::CONFIG_FIELDS_KEY) ?? [];
Expand All @@ -61,7 +60,7 @@ private function _upgradeFromCraft2()
if ($field['type'] === 'FruitLinkIt')
{
$type = LinkitField::class;
$settings = $this->_migrateFieldSettings($field['settings'] ? Json::decode($field['settings']) : null);
$settings = $this->_migrateFieldSettings($field['settings']);

$field['type'] = $type;
$field['settings'] = $settings;
Expand All @@ -70,6 +69,7 @@ private function _upgradeFromCraft2()
'type' => $type,
'settings' => Json::encode($settings),
], ['uid' => $fieldUid]);

$projectConfig->set(Fields::CONFIG_FIELDS_KEY . '.' . $fieldUid, $field);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/migrations/m180423_175007_linkit_craft2.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class m180423_175007_linkit_craft2 extends Migration
public function safeUp()
{
$this->_upgradeFromCraft2();
return true;
}

private function _upgradeFromCraft2()
Expand All @@ -47,12 +48,11 @@ private function _upgradeFromCraft2()
case 'fruitlinkit':
case 'fruit-link-it':
case 'fruit-linkit':
$this->delete('{{%plugins}}', ['handle' => $pluginHandle]);
$projectConfig->remove(Plugins::CONFIG_PLUGINS_KEY . '.' . $pluginHandle);
break;
}
}

$this->delete('{{%plugins}}', ['handle' => ['fruitlinkit', 'fruit-linkit', 'fruit-link-it']]);

// Get the field data from the project config
$fields = $projectConfig->get(Fields::CONFIG_FIELDS_KEY) ?? [];
Expand All @@ -61,7 +61,7 @@ private function _upgradeFromCraft2()
if ($field['type'] === 'FruitLinkIt')
{
$type = LinkitField::class;
$settings = $this->_migrateFieldSettings($field['settings'] ? Json::decode($field['settings']) : null);
$settings = $this->_migrateFieldSettings($field['settings']);

$field['type'] = $type;
$field['settings'] = $settings;
Expand All @@ -70,6 +70,7 @@ private function _upgradeFromCraft2()
'type' => $type,
'settings' => Json::encode($settings),
], ['uid' => $fieldUid]);

$projectConfig->set(Fields::CONFIG_FIELDS_KEY . '.' . $fieldUid, $field);
}
}
Expand Down

0 comments on commit 3249793

Please sign in to comment.