Skip to content

Commit

Permalink
Fix #199
Browse files Browse the repository at this point in the history
v2.2.7
  • Loading branch information
ttempleton committed Mar 22, 2019
1 parent 0066670 commit 0c1192d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
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": "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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
11 changes: 5 additions & 6 deletions src/services/BlockTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 0c1192d

Please sign in to comment.