Skip to content

Commit 7aa1568

Browse files
committed
ACP2E-1512: Env variable config not working for store views with capital letters in the code
covered env setting issue
1 parent c2b91cd commit 7aa1568

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

app/code/Magento/Store/Model/Config/Processor/Fallback.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ private function prepareWebsitesConfig(
111111
array $websitesConfig
112112
) {
113113
$result = [];
114+
115+
foreach ($websitesConfig as $websiteCode => $webConfiguration) {
116+
if (!isset($websitesConfig[strtolower($websiteCode)])) {
117+
$websitesConfig[strtolower($websiteCode)] = $webConfiguration;
118+
unset($websitesConfig[$websiteCode]);
119+
}
120+
}
114121
foreach ((array)$this->websiteData as $website) {
115122
$code = $website['code'];
116123
$id = $website['website_id'];
@@ -136,6 +143,12 @@ private function prepareStoresConfig(
136143
) {
137144
$result = [];
138145

146+
foreach ($storesConfig as $storeCode => $storeConfiguration) {
147+
if (!isset($storesConfig[strtolower($storeCode)])) {
148+
$storesConfig[strtolower($storeCode)] = $storeConfiguration;
149+
unset($storesConfig[$storeCode]);
150+
}
151+
}
139152
foreach ((array)$this->storeData as $store) {
140153
$code = $store['code'];
141154
$id = $store['store_id'];

app/code/Magento/Store/Test/Unit/Model/Config/Processor/FallbackTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testProcessWithStoreCodeCapitalLetters()
7878
$result = $this->fallback->process(
7979
[
8080
'stores' => [
81-
'two' => [
81+
'TWO' => [
8282
'checkout' => [
8383
'options' => ['guest_checkout' => 0]
8484
]

0 commit comments

Comments
 (0)