From f39895c0aa52d36d7216546a5335158f47a2af0f Mon Sep 17 00:00:00 2001 From: Bart van Gennep Date: Wed, 14 Nov 2018 17:07:46 +0100 Subject: [PATCH] Fixed user field sources not being exported --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/Behaviors/SourcesBehavior.php | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a60a8399..8fae367b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 4.0.18 +### Fixed +- Fixed user field sources not being exported + ### 4.0.17 - 2018-09-24 ### Fixed - Fixed backwards compatibility of element index mapper diff --git a/composer.json b/composer.json index efffb876..4da763e9 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "version": "4.0.17", + "version": "4.0.18", "name": "nerds-and-company/schematic", "description": "Craft setup and sync tool", "type": "craft-plugin", diff --git a/src/Behaviors/SourcesBehavior.php b/src/Behaviors/SourcesBehavior.php index 3f969fdd..c2d3a8d4 100644 --- a/src/Behaviors/SourcesBehavior.php +++ b/src/Behaviors/SourcesBehavior.php @@ -7,6 +7,7 @@ use yii\base\Behavior; use craft\base\Model; use craft\records\VolumeFolder; +use craft\fields\Users; use NerdsAndCompany\Schematic\Schematic; use NerdsAndCompany\Schematic\Events\SourceMappingEvent; @@ -123,7 +124,7 @@ public function getSource(string $fieldType, string $source = null, string $inde break; case 'group': case 'editCategories': - $service = 'Users' == $fieldType ? Craft::$app->userGroups : Craft::$app->categories; + $service = Users::class == $fieldType ? Craft::$app->userGroups : Craft::$app->categories; $method = 'getGroupBy'; break; case 'folder':