Skip to content

Commit

Permalink
ENGCOM-2806: [Backport] Fixed review list ajax if product not exist r…
Browse files Browse the repository at this point in the history
…edirect to 404 page #13102 #17632

 - Merge Pull Request #17632 from mage2pratik/magento2:2.1-develop-PR-port-15369
 - Merged commits:
   1. 81c0320
   2. c729a3b
   3. 53ba0ac
   4. 01a7e20
  • Loading branch information
magento-engcom-team committed Aug 16, 2018
2 parents bc213c6 + 01a7e20 commit a1bb56e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/code/Magento/Review/Controller/Product/ListAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ class ListAjax extends ProductController
/**
* Show list of product's reviews
*
* @return \Magento\Framework\View\Result\Layout
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Layout
*/
public function execute()
{
if (!$this->initProduct()) {
throw new LocalizedException(__('Cannot initialize product'));
} else {
/** @var \Magento\Framework\View\Result\Layout $resultLayout */
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD);
return $resultForward->forward('noroute');
}

return $resultLayout;
return $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
}
}

0 comments on commit a1bb56e

Please sign in to comment.