Skip to content

Commit 42d5c03

Browse files
committed
MAGE-848 Add reinit to config migration data patch
1 parent 5a28d9f commit 42d5c03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Setup/Patch/Data/MigrateVirtualReplicaConfigPatch.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Algolia\AlgoliaSearch\Service\StoreNameFetcher;
1212
use Algolia\AlgoliaSearch\Validator\VirtualReplicaValidatorFactory;
1313
use Magento\Framework\App\Config\ConfigResource\ConfigInterface;
14+
use Magento\Framework\App\Config\ReinitableConfigInterface;
1415
use Magento\Framework\App\Config\ScopeConfigInterface;
1516
use Magento\Framework\App\Config\Storage\WriterInterface;
1617
use Magento\Framework\Exception\LocalizedException;
@@ -28,7 +29,7 @@ public function __construct(
2829
protected ModuleDataSetupInterface $moduleDataSetup,
2930
protected WriterInterface $configWriter,
3031
protected ConfigInterface $config,
31-
protected ScopeConfigInterface $scopeConfig,
32+
protected ReinitableConfigInterface $scopeConfig,
3233
protected ConfigHelper $configHelper,
3334
protected ConfigChecker $configChecker,
3435
protected ReplicaManagerInterface $replicaManager,
@@ -49,6 +50,8 @@ public function apply(): PatchInterface
4950

5051
$this->configChecker->checkAndApplyAllScopes(ConfigHelper::LEGACY_USE_VIRTUAL_REPLICA_ENABLED, [$this, 'migrateSetting']);
5152

53+
$this->scopeConfig->reinit();
54+
5255
$this->moduleDataSetup->getConnection()->endSetup();
5356

5457
return $this;

0 commit comments

Comments
 (0)