diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e264b5..08087c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.2.7 - 2019-03-23 +### Fixed +- Fixed issue, when applying a project config to another environment or project, where a Neo field and block types could be synced before other fields they use, causing the block types not to have those fields in the target environment/project + ## 2.2.6 - 2019-03-14 ### Changed - Neo now requires Craft 3.1.13 or later diff --git a/composer.json b/composer.json index 8901d0f1..0450b299 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "spicyweb/craft-neo", "description": "A Matrix-like field type that uses existing fields", - "version": "2.2.6", + "version": "2.2.7", "type": "craft-plugin", "keywords": [ "cms", diff --git a/package.json b/package.json index 6e9da110..00cb4edb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "craft-neo", - "version": "2.2.6", + "version": "2.2.7", "description": "A Matrix-like field type that uses existing fields", "main": "webpack.config.js", "scripts": { diff --git a/src/services/BlockTypes.php b/src/services/BlockTypes.php index d5cd8ab9..aa4c671d 100644 --- a/src/services/BlockTypes.php +++ b/src/services/BlockTypes.php @@ -7,6 +7,7 @@ use craft\db\Query; use craft\events\ConfigEvent; use craft\helpers\Db; +use craft\helpers\ProjectConfig as ProjectConfigHelper; use craft\helpers\StringHelper; use craft\models\FieldLayout; use craft\models\FieldLayoutTab; @@ -310,12 +311,10 @@ public function handleChangedBlockType(ConfigEvent $event) $uid = $event->tokenMatches[0]; $data = $event->newValue; - // Make sure the field has been synced - if (($fieldId = Db::idByUid('{{%fields}}', $data['field'])) === null) - { - $projectConfigService->defer($event, [$this, __FUNCTION__]); - return; - } + // Make sure the fields have been synced + ProjectConfigHelper::ensureAllFieldsProcessed(); + + $fieldId = Db::idByUid('{{%fields}}', $data['field']); $transaction = $dbService->beginTransaction();