Skip to content

Commit

Permalink
Do last field import after hook imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bvangennep committed Dec 14, 2018
1 parent 0860ddb commit edf5443
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 3.8.12 ###
- Do last fields import after hook imports

### 3.8.11 ###
- Fixed registerSchematicSources hook

Expand Down
10 changes: 5 additions & 5 deletions src/Services/Schematic.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ private function importDataModel(Data $model, $force, $dataTypes = 'all')
$userImportResult = Craft::app()->schematic_users->import($users, true);
}

if (in_array('fields', $dataTypes)) {
$fields = $model->getAttribute('fields');
$fieldImportResultFinal = Craft::app()->schematic_fields->import($fields, $force);
}

if (in_array('elementIndexSettings', $dataTypes)) {
// Element index settings are supported from Craft 2.5
if (version_compare(CRAFT_VERSION, '2.5', '>=')) {
Expand Down Expand Up @@ -227,6 +222,11 @@ private function importDataModel(Data $model, $force, $dataTypes = 'all')
$services = Craft::app()->plugins->call('registerMigrationService');
$this->doImport($result, $model->pluginData, $services, $force);

if (in_array('fields', $dataTypes)) {
$fields = $model->getAttribute('fields');
$fieldImportResultFinal = Craft::app()->schematic_fields->import($fields, $force);
}

return $result;
}

Expand Down

0 comments on commit edf5443

Please sign in to comment.