File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
app/code/Magento/Customer/ViewModel/Customer
dev/tests/integration/testsuite/Magento/Store/_files Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,12 @@ private function getStoreOptionsWithCurrentWebsiteId(): array
113
113
if (!empty ($ this ->dataPersistor ->get ('customer ' )['account ' ])) {
114
114
$ currentWebsiteId = (string )$ this ->dataPersistor ->get ('customer ' )['account ' ]['website_id ' ];
115
115
} else {
116
- $ currentWebsiteId = $ this ->storeManager ->getDefaultStoreView ()->getWebsiteId ();
116
+ $ defaultStore = $ this ->storeManager ->getDefaultStoreView ();
117
+ if (!$ defaultStore ) {
118
+ $ stores = $ this ->storeManager ->getStores ();
119
+ $ defaultStore = array_shift ($ stores );
120
+ }
121
+ $ currentWebsiteId = $ defaultStore ->getWebsiteId ();
117
122
}
118
123
119
124
foreach ($ options as $ key => $ option ) {
Original file line number Diff line number Diff line change 56
56
$ storeResource ->save ($ store );
57
57
/* Refresh CatalogSearch index */
58
58
/** @var IndexerRegistry $indexerRegistry */
59
+ $ storeManager ->reinitStores ();
59
60
$ indexerRegistry = $ objectManager ->get (IndexerRegistry::class);
60
61
$ indexerRegistry ->get (Fulltext::INDEXER_ID )->reindexAll ();
You can’t perform that action at this time.
0 commit comments