File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
app/code/Magento/Backend/Controller/Adminhtml/System/Store Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,18 @@ private function processWebsiteSave($postData)
33
33
$ websiteModel ->setId (null );
34
34
}
35
35
36
+ $ groupModel = $ this ->_objectManager ->create (\Magento \Store \Model \Group::class);
37
+ $ groupModel ->load ($ websiteModel ->getDefaultGroupId ());
38
+
39
+ $ storeModel = $ this ->_objectManager ->create (\Magento \Store \Model \Store::class);
40
+ $ storeModel ->load ($ groupModel ->getDefaultStoreId ());
41
+
42
+ if ($ websiteModel ->getIsDefault () && !$ storeModel ->isActive ()) {
43
+ throw new \Magento \Framework \Exception \LocalizedException (
44
+ __ ("Please enable your Store View before using this Web Site as Default " )
45
+ );
46
+ }
47
+
36
48
$ websiteModel ->save ();
37
49
$ this ->messageManager ->addSuccessMessage (__ ('You saved the website. ' ));
38
50
@@ -99,6 +111,7 @@ private function processGroupSave($postData)
99
111
__ ('An inactive store view cannot be saved as default store view ' )
100
112
);
101
113
}
114
+
102
115
$ groupModel ->save ();
103
116
$ this ->messageManager ->addSuccessMessage (__ ('You saved the store. ' ));
104
117
You can’t perform that action at this time.
0 commit comments