Skip to content

Commit

Permalink
MAGETWO-62648: [Github] Parameters from website configuration isn't a…
Browse files Browse the repository at this point in the history
…pplied to the corresponding store view #7943
  • Loading branch information
OlgaVasyltsun committed Dec 26, 2016
1 parent 40b513d commit 40fd024
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Review/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getDetailHtml($origDetail)
*/
public function getIsGuestAllowToWrite()
{
return $this->scopeConfig->isSetFlag(self::XML_REVIEW_GUETS_ALLOW, \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES);
return $this->scopeConfig->isSetFlag(self::XML_REVIEW_GUETS_ALLOW, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
}

/**
Expand Down
7 changes: 4 additions & 3 deletions app/code/Magento/Store/Model/Config/Processor/Fallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,21 @@ private function prepareStoresConfig(
}

/**
* Retrieve Website Config
* Find by id specific information about website.
*
* @param array $websites
* @param array $websites Has next format: (website_code => [website_data])
* @param int $id
* @return array
*/
private function getWebsiteConfig(array $websites, $id)
{
foreach ($this->websiteData as $website) {
if ($website['website_id'] == $id) {
$code = $website['website_id'];
$code = $website['code'];
return isset($websites[$code]) ? $websites[$code] : [];
}
}

return [];
}
}
10 changes: 8 additions & 2 deletions app/code/Magento/Store/Model/ResourceModel/Website.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,23 @@ protected function _initUniqueFields()
}

/**
* Read information about all websites
* Read all information about websites. Convert information to next format:
* [website_code => [website_data (website_id, code, name, etc...)]]
*
* @return array
*/
public function readAllWebsites()
{
$websites = [];
$select = $this->getConnection()
->select()
->from($this->getTable('store_website'));

return $this->getConnection()->fetchAll($select);

This comment has been minimized.

Copy link
@sshymko

sshymko Feb 8, 2017

Consider \Zend_Db_Adapter_Abstract::fetchAssoc() to avoid post-processing results in the loop below.

foreach($this->getConnection()->fetchAll($select) as $websiteData) {
$websites[$websiteData['code']] = $websiteData;
}

return $websites;
}

/**
Expand Down

0 comments on commit 40fd024

Please sign in to comment.