Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kassner/d9ee8ab3ba5e0d1249609a21360dc0b9 to your computer and use it in GitHub Desktop.
Save kassner/d9ee8ab3ba5e0d1249609a21360dc0b9 to your computer and use it in GitHub Desktop.
--- vendor/magento/module-config/Model/Config/Importer.php
+++ vendor/magento/module-config/Model/Config/Importer.php
@@ -74,6 +74,8 @@
*/
private $saveProcessor;
+ private $eventConfig;
+
/**
* @param FlagManager $flagManager The flag manager
* @param ArrayUtils $arrayUtils An array utils
@@ -88,7 +90,8 @@
SaveProcessor $saveProcessor,
ScopeConfigInterface $scopeConfig,
State $state,
- ScopeInterface $scope
+ ScopeInterface $scope,
+ \Magento\Framework\Event\ConfigInterface $eventConfig
) {
$this->flagManager = $flagManager;
$this->arrayUtils = $arrayUtils;
@@ -96,6 +99,7 @@
$this->scopeConfig = $scopeConfig;
$this->state = $state;
$this->scope = $scope;
+ $this->eventConfig = $eventConfig;
}
/**
@@ -130,6 +134,8 @@
// Invoke saving of new values.
$this->saveProcessor->process($changedData);
});
+
+ $this->eventConfig->cleanCache();
$this->scope->setCurrentScope($currentScope);
$this->flagManager->saveFlag(static::FLAG_CODE, $data);
--- vendor/magento/framework/Config/Data/Scoped.php
+++ vendor/magento/framework/Config/Data/Scoped.php
@@ -96,6 +96,12 @@
$this->_loadScopedData();
return parent::get($path, $default);
}
+
+ public function cleanCache()
+ {
+ $this->_loadedScopes = [];
+ $this->_data = [];
+ }
/**
* Load data for current scope
--- vendor/magento/framework/Event/Config.php
+++ vendor/magento/framework/Event/Config.php
@@ -36,4 +36,9 @@
{
return $this->_dataContainer->get($eventName, []);
}
+
+ public function cleanCache()
+ {
+ $this->_dataContainer->cleanCache();
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment