File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
app/code/Magento/Store/Model Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -414,12 +414,12 @@ public function beforeDelete()
414
414
*/
415
415
public function afterDelete ()
416
416
{
417
- $ this ->_storeManager ->reinitStores ();
418
417
$ group = $ this ;
419
418
$ this ->getResource ()->addCommitCallback (function () use ($ group ) {
420
419
$ this ->_storeManager ->reinitStores ();
421
420
$ this ->eventManager ->dispatch ($ this ->_eventPrefix . '_delete ' , ['group ' => $ group ]);
422
421
});
422
+ $ result = parent ::afterDelete ();
423
423
424
424
if ($ this ->getId () === $ this ->getWebsite ()->getDefaultGroupId ()) {
425
425
$ ids = $ this ->getWebsite ()->getGroupIds ();
@@ -432,15 +432,14 @@ public function afterDelete()
432
432
$ this ->getWebsite ()->setDefaultGroupId ($ defaultId );
433
433
$ this ->getWebsite ()->save ();
434
434
}
435
- return parent :: afterDelete () ;
435
+ return $ result ;
436
436
}
437
437
438
438
/**
439
439
* @inheritdoc
440
440
*/
441
441
public function afterSave ()
442
442
{
443
- $ this ->_storeManager ->reinitStores ();
444
443
$ group = $ this ;
445
444
$ this ->getResource ()->addCommitCallback (function () use ($ group ) {
446
445
$ this ->_storeManager ->reinitStores ();
Original file line number Diff line number Diff line change @@ -1056,7 +1056,6 @@ public function getWebsiteId()
1056
1056
*/
1057
1057
public function afterSave ()
1058
1058
{
1059
- $ this ->_storeManager ->reinitStores ();
1060
1059
if ($ this ->isObjectNew ()) {
1061
1060
$ event = $ this ->_eventPrefix . '_add ' ;
1062
1061
} else {
@@ -1247,6 +1246,11 @@ public function beforeDelete()
1247
1246
*/
1248
1247
public function afterDelete ()
1249
1248
{
1249
+ $ store = $ this ;
1250
+ $ this ->getResource ()->addCommitCallback (function () use ($ store ) {
1251
+ $ this ->_storeManager ->reinitStores ();
1252
+ $ this ->eventManager ->dispatch ($ this ->_eventPrefix . '_delete ' , ['store ' => $ store ]);
1253
+ });
1250
1254
parent ::afterDelete ();
1251
1255
$ this ->_configCacheType ->clean ();
1252
1256
@@ -1261,11 +1265,7 @@ public function afterDelete()
1261
1265
$ this ->getGroup ()->setDefaultStoreId ($ defaultId );
1262
1266
$ this ->getGroup ()->save ();
1263
1267
}
1264
- $ store = $ this ;
1265
- $ this ->getResource ()->addCommitCallback (function () use ($ store ) {
1266
- $ this ->_storeManager ->reinitStores ();
1267
- $ this ->eventManager ->dispatch ($ this ->_eventPrefix . '_delete ' , ['store ' => $ store ]);
1268
- });
1268
+
1269
1269
return $ this ;
1270
1270
}
1271
1271
You can’t perform that action at this time.
0 commit comments