Skip to content

Commit 5adec77

Browse files
author
Pascal Querner
committed
feat?: call env helper on config get
1 parent 5580b83 commit 5adec77

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
@@ -66,8 +66,10 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
6666
$nodePath = $this->buildNodePath($scope, $path);
6767
$xmlConfig->setNode($nodePath, $value);
6868
try {
69-
$store = Mage::app()->getStore(0);
70-
$this->setCache($store, $value, $path);
69+
foreach (['0', 'admin'] as $store) {
70+
$store = Mage::app()->getStore($store);
71+
$this->setCache($store, $value, $path);
72+
}
7173
} catch (Throwable $exception) {
7274
Mage::logException($exception);
7375
}
@@ -83,8 +85,10 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
8385
$xmlConfig->setNode($nodePath, $value);
8486
try {
8587
if (!str_contains($nodePath, 'websites')) {
86-
$store = Mage::app()->getStore($storeCode);
87-
$this->setCache($store, $value, $path);
88+
foreach ([$storeCode, 'admin'] as $store) {
89+
$store = Mage::app()->getStore($store);
90+
$this->setCache($store, $value, $path);
91+
}
8892
}
8993
} catch (Throwable $exception) {
9094
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
@@ -336,6 +336,9 @@ public function getConfig($path)
336336
}
337337

338338
$config = Mage::getConfig();
339+
/** @var Mage_Core_Helper_EnvironmentConfigLoader $environmentConfigLoaderHelper */
340+
$environmentConfigLoaderHelper = Mage::helper('core/environmentConfigLoader');
341+
$environmentConfigLoaderHelper->overrideEnvironment($config);
339342

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

0 commit comments

Comments
 (0)