File tree 2 files changed +16
-9
lines changed
app/code/Magento/Store/Model/ResourceModel
2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -166,11 +166,16 @@ protected function _changeGroup(\Magento\Framework\Model\AbstractModel $model)
166
166
*/
167
167
public function readAllStores ()
168
168
{
169
- $ select = $ this ->getConnection ()
170
- ->select ()
171
- ->from ($ this ->getTable ('store ' ));
169
+ $ stores = [];
170
+ if ($ this ->getConnection ()->isTableExists ($ this ->getMainTable ())) {
171
+ $ select = $ this ->getConnection ()
172
+ ->select ()
173
+ ->from ($ this ->getTable ($ this ->getMainTable ()));
172
174
173
- return $ this ->getConnection ()->fetchAll ($ select );
175
+ $ stores = $ this ->getConnection ()->fetchAll ($ select );
176
+ }
177
+
178
+ return $ stores ;
174
179
}
175
180
176
181
/**
Original file line number Diff line number Diff line change @@ -47,12 +47,14 @@ protected function _initUniqueFields()
47
47
public function readAllWebsites ()
48
48
{
49
49
$ websites = [];
50
- $ select = $ this ->getConnection ()
51
- ->select ()
52
- ->from ($ this ->getTable ('store_website ' ));
50
+ if ($ this ->getConnection ()->isTableExists ($ this ->getMainTable ())) {
51
+ $ select = $ this ->getConnection ()
52
+ ->select ()
53
+ ->from ($ this ->getTable ($ this ->getMainTable ()));
53
54
54
- foreach ($ this ->getConnection ()->fetchAll ($ select ) as $ websiteData ) {
55
- $ websites [$ websiteData ['code ' ]] = $ websiteData ;
55
+ foreach ($ this ->getConnection ()->fetchAll ($ select ) as $ websiteData ) {
56
+ $ websites [$ websiteData ['code ' ]] = $ websiteData ;
57
+ }
56
58
}
57
59
58
60
return $ websites ;
You can’t perform that action at this time.
0 commit comments