Skip to content

Commit 79c384a

Browse files
committed
Integration failure fixed
1 parent 6a01b74 commit 79c384a

File tree

1 file changed

+10
-1
lines changed
  • app/code/Magento/Catalog/Controller/Category

1 file changed

+10
-1
lines changed

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,16 @@ public function execute()
216216

217217
$category = $this->_initCategory();
218218
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+
}
220229
}
221230

222231
$pageRedirect = $this->handlePageRedirect($category);

0 commit comments

Comments
 (0)