Skip to content

Commit b7247d4

Browse files
author
Sergii Kovalenko
committed
MAGETWO-60890: Fatal error logging in as admin user with restricted role
1 parent b93433d commit b7247d4

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

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

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ class Store extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1515
*/
1616
protected $configCache;
1717

18-
/**
19-
* @var array
20-
*/
21-
private $storesCache;
22-
2318
/**
2419
* @param \Magento\Framework\Model\ResourceModel\Db\Context $context
2520
* @param \Magento\Framework\App\Cache\Type\Config $configCacheType
@@ -167,15 +162,11 @@ protected function _changeGroup(\Magento\Framework\Model\AbstractModel $model)
167162
*/
168163
public function readAllStores()
169164
{
170-
if (!$this->storesCache) {
171-
$select = $this->getConnection()
172-
->select()
173-
->from($this->getTable('store'));
174-
175-
$this->storesCache = $this->getConnection()->fetchAll($select);
176-
}
165+
$select = $this->getConnection()
166+
->select()
167+
->from($this->getTable('store'));
177168

178-
return $this->storesCache;
169+
return $this->getConnection()->fetchAll($select);
179170
}
180171

181172
/**

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,11 @@ protected function _initUniqueFields()
4646
*/
4747
public function readAllWebsites()
4848
{
49-
if (!$this->websitesCache) {
50-
$select = $this->getConnection()
51-
->select()
52-
->from($this->getTable('store_website'));
49+
$select = $this->getConnection()
50+
->select()
51+
->from($this->getTable('store_website'));
5352

54-
$this->websitesCache = $this->getConnection()->fetchAll($select);
55-
}
56-
57-
return $this->websitesCache;
53+
return $this->getConnection()->fetchAll($select);
5854
}
5955

6056
/**

0 commit comments

Comments
 (0)