Skip to content

Commit

Permalink
Fixed issue where global set sources weren't linked because they were…
Browse files Browse the repository at this point in the history
… cached
  • Loading branch information
boboldehampsink committed Jan 10, 2019
1 parent 322f91c commit 43220ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/DataTypes/GlobalSetDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 43220ab

Please sign in to comment.