Skip to content

Commit 49d4e75

Browse files
author
Pascal Querner
committed
feat?: call env helper on config get
1 parent 85907b5 commit 49d4e75

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
7373
$nodePath = $this->buildNodePath($scope, $path);
7474
$xmlConfig->setNode($nodePath, $value);
7575
try {
76-
$store = Mage::app()->getStore(0);
77-
$this->setCache($store, $value, $path);
76+
foreach (['0', 'admin'] as $store) {
77+
$store = Mage::app()->getStore($store);
78+
$this->setCache($store, $value, $path);
79+
}
7880
} catch (Throwable $exception) {
7981
Mage::logException($exception);
8082
}
@@ -90,8 +92,10 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
9092
$xmlConfig->setNode($nodePath, $value);
9193
try {
9294
if (!str_contains($nodePath, 'websites')) {
93-
$store = Mage::app()->getStore($storeCode);
94-
$this->setCache($store, $value, $path);
95+
foreach ([$storeCode, 'admin'] as $store) {
96+
$store = Mage::app()->getStore($store);
97+
$this->setCache($store, $value, $path);
98+
}
9599
}
96100
} catch (Throwable $exception) {
97101
Mage::logException($exception);

app/code/core/Mage/Core/Model/Store.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ public function getConfig($path)
344344
}
345345

346346
$config = Mage::getConfig();
347+
/** @var Mage_Core_Helper_EnvironmentConfigLoader $environmentConfigLoaderHelper */
348+
$environmentConfigLoaderHelper = Mage::helper('core/environmentConfigLoader');
349+
$environmentConfigLoaderHelper->overrideEnvironment($config);
347350

348351
$fullPath = 'stores/' . $this->getCode() . '/' . $path;
349352
$data = $config->getNode($fullPath);

0 commit comments

Comments
 (0)