diff --git a/CHANGELOG.md b/CHANGELOG.md index ded1ff6a..5c8d50f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 4.1.1 - 2019-01-08 ### Fixed - Fixed "assign user group" permissions not being exported +- Fixed issue where global set sources weren't linked because they were cached ## 4.1.0 - 2018-11-19 ### Added diff --git a/src/DataTypes/GlobalSetDataType.php b/src/DataTypes/GlobalSetDataType.php index a1021d00..a426b08e 100644 --- a/src/DataTypes/GlobalSetDataType.php +++ b/src/DataTypes/GlobalSetDataType.php @@ -35,4 +35,18 @@ public function getRecords(): array { return Craft::$app->globals->getAllSets(); } + + /** + * Reset craft global sets cache using reflection. + */ + public function afterImport() + { + $obj = Craft::$app->globals; + $refObject = new \ReflectionObject($obj); + if ($refObject->hasProperty('_allGlobalSets')) { + $refProperty1 = $refObject->getProperty('_allGlobalSets'); + $refProperty1->setAccessible(true); + $refProperty1->setValue($obj, null); + } + } }