File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ public function execute()
63
63
$ storeId = $ this ->getRequest ()->getParam ('store ' );
64
64
$ redirectBack = $ this ->getRequest ()->getParam ('back ' , false );
65
65
$ productId = $ this ->getRequest ()->getParam ('id ' );
66
+ $ resultRedirect = $ this ->resultRedirectFactory ->create ();
66
67
67
68
$ data = $ this ->getRequest ()->getPost ();
68
69
if ($ data ) {
@@ -121,9 +122,12 @@ public function execute()
121
122
$ this ->_session ->setProductData ($ data );
122
123
$ redirectBack = $ productId ? true : 'new ' ;
123
124
}
125
+ } else {
126
+ $ resultRedirect ->setPath ('catalog/*/ ' , ['store ' => $ storeId ]);
127
+ $ this ->messageManager ->addError ('No data to save ' );
128
+ return $ resultRedirect ;
124
129
}
125
130
126
- $ resultRedirect = $ this ->resultRedirectFactory ->create ();
127
131
if ($ redirectBack === 'new ' ) {
128
132
$ resultRedirect ->setPath (
129
133
'catalog/*/new ' ,
You can’t perform that action at this time.
0 commit comments