@@ -82,7 +82,7 @@ public function overrideEnvironment(Varien_Simplexml_Config $xmlConfig)
82
82
83
83
case static ::CONFIG_KEY_WEBSITES :
84
84
case static ::CONFIG_KEY_STORES :
85
- [$ unused1 , $ unused2 , $ code , $ section , $ group , $ field ] = $ configKeyParts ;
85
+ [$ unused1 , $ unused2 , $ storeCode , $ section , $ group , $ field ] = $ configKeyParts ;
86
86
$ path = $ this ->buildPath ($ section , $ group , $ field );
87
87
$ storeCode = strtolower ($ storeCode );
88
88
$ scope = strtolower ($ scope );
@@ -130,9 +130,11 @@ public function hasPath(string $wantedPath): bool
130
130
131
131
case static ::CONFIG_KEY_WEBSITES :
132
132
case static ::CONFIG_KEY_STORES :
133
- list ( $ unused1 , $ unused2 , $ storeCode , $ section , $ group , $ field) = $ configKeyParts ;
133
+ [ $ unused1 , $ unused2 , $ storeCode , $ section , $ group , $ field] = $ configKeyParts ;
134
134
$ path = $ this ->buildPath ($ section , $ group , $ field );
135
- $ nodePath = $ this ->buildNodePath ($ scope , $ path );
135
+ $ storeCode = strtolower ($ storeCode );
136
+ $ scope = strtolower ($ scope );
137
+ $ nodePath = sprintf ('%s/%s/%s ' , $ scope , $ storeCode , $ path );
136
138
$ config [$ nodePath ] = $ value ;
137
139
break ;
138
140
}
@@ -142,9 +144,9 @@ public function hasPath(string $wantedPath): bool
142
144
return $ hasConfig ;
143
145
}
144
146
145
- public function getAsArray (string $ wantedScope ): array
147
+ public function getAsArray (string $ wantedStore ): array
146
148
{
147
- $ data = Mage::registry ("config_env_array_ $ wantedScope " );
149
+ $ data = Mage::registry ("config_env_array_ $ wantedStore " );
148
150
if ($ data !== null ) {
149
151
return $ data ;
150
152
}
@@ -157,26 +159,20 @@ public function getAsArray(string $wantedScope): array
157
159
}
158
160
159
161
list ($ configKeyParts , $ scope ) = $ this ->getConfigKey ($ configKey );
160
- if (strtolower ($ scope ) !== strtolower ($ wantedScope )) {
161
- continue ;
162
- }
163
162
164
163
switch ($ scope ) {
165
- case static ::CONFIG_KEY_DEFAULT :
166
- list ($ unused1 , $ unused2 , $ section , $ group , $ field ) = $ configKeyParts ;
167
- $ path = $ this ->buildPath ($ section , $ group , $ field );
168
- $ config [$ path ] = $ value ;
169
- break ;
170
-
171
164
case static ::CONFIG_KEY_WEBSITES :
172
165
case static ::CONFIG_KEY_STORES :
173
- list ($ unused1 , $ unused2 , $ storeCode , $ section , $ group , $ field ) = $ configKeyParts ;
166
+ [$ unused1 , $ unused2 , $ storeCode , $ section , $ group , $ field ] = $ configKeyParts ;
167
+ if (strtolower ($ storeCode ) !== strtolower ($ wantedStore )) {
168
+ break ;
169
+ }
174
170
$ path = $ this ->buildPath ($ section , $ group , $ field );
175
171
$ config [$ path ] = $ value ;
176
172
break ;
177
173
}
178
174
}
179
- Mage::register ("config_env_array_ $ wantedScope " , $ config );
175
+ Mage::register ("config_env_array_ $ wantedStore " , $ config );
180
176
return $ config ;
181
177
}
182
178
@@ -212,8 +208,11 @@ protected function setCache(Mage_Core_Model_Store $store, $value, string $path):
212
208
$ refProperty = $ refObject ->getProperty ('_configCache ' );
213
209
$ refProperty ->setAccessible (true );
214
210
$ configCache = $ refProperty ->getValue ($ store );
211
+ if (!is_array ($ configCache )) {
212
+ $ configCache = [];
213
+ }
215
214
$ configCache [$ path ] = $ value ;
216
- $ refProperty -> setValue ( $ store , $ configCache );
215
+ $ store -> setConfigCache ( $ configCache );
217
216
}
218
217
219
218
protected function getConfigKey (string $ configKey ): array
0 commit comments