File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
app/code/Magento/Catalog/Controller/Category Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,16 @@ public function execute()
216
216
217
217
$ category = $ this ->_initCategory ();
218
218
if (!$ category ) {
219
- return $ this ->resultForwardFactory ->create ()->forward ('noroute ' );
219
+ $ categoryId = (int )$ this ->getRequest ()->getParam ('id ' , false );
220
+ try {
221
+ $ existingCategory = $ this ->categoryRepository ->get (
222
+ $ categoryId ,
223
+ $ this ->_storeManager ->getStore ()->getId ()
224
+ );
225
+ return $ this ->resultRedirectFactory ->create ()->setUrl ($ this ->_redirect ->getRedirectUrl ());
226
+ } catch (NoSuchEntityException $ e ) {
227
+ return $ this ->resultForwardFactory ->create ()->forward ('noroute ' );
228
+ }
220
229
}
221
230
222
231
$ pageRedirect = $ this ->handlePageRedirect ($ category );
You can’t perform that action at this time.
0 commit comments