Skip to content

Commit 40fd024

Browse files
committed
MAGETWO-62648: [Github] Parameters from website configuration isn't applied to the corresponding store view #7943
1 parent 40b513d commit 40fd024

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

app/code/Magento/Review/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getDetailHtml($origDetail)
7474
*/
7575
public function getIsGuestAllowToWrite()
7676
{
77-
return $this->scopeConfig->isSetFlag(self::XML_REVIEW_GUETS_ALLOW, \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES);
77+
return $this->scopeConfig->isSetFlag(self::XML_REVIEW_GUETS_ALLOW, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
7878
}
7979

8080
/**

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,21 @@ private function prepareStoresConfig(
158158
}
159159

160160
/**
161-
* Retrieve Website Config
161+
* Find by id specific information about website.
162162
*
163-
* @param array $websites
163+
* @param array $websites Has next format: (website_code => [website_data])
164164
* @param int $id
165165
* @return array
166166
*/
167167
private function getWebsiteConfig(array $websites, $id)
168168
{
169169
foreach ($this->websiteData as $website) {
170170
if ($website['website_id'] == $id) {
171-
$code = $website['website_id'];
171+
$code = $website['code'];
172172
return isset($websites[$code]) ? $websites[$code] : [];
173173
}
174174
}
175+
175176
return [];
176177
}
177178
}

app/code/Magento/Store/Model/ResourceModel/Website.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,23 @@ protected function _initUniqueFields()
4040
}
4141

4242
/**
43-
* Read information about all websites
43+
* Read all information about websites. Convert information to next format:
44+
* [website_code => [website_data (website_id, code, name, etc...)]]
4445
*
4546
* @return array
4647
*/
4748
public function readAllWebsites()
4849
{
50+
$websites = [];
4951
$select = $this->getConnection()
5052
->select()
5153
->from($this->getTable('store_website'));
5254

53-
return $this->getConnection()->fetchAll($select);
55+
foreach($this->getConnection()->fetchAll($select) as $websiteData) {
56+
$websites[$websiteData['code']] = $websiteData;
57+
}
58+
59+
return $websites;
5460
}
5561

5662
/**

0 commit comments

Comments
 (0)