Skip to content

Commit

Permalink
ENGCOM-2720: Fixed review list ajax if product not exist redirect to …
Browse files Browse the repository at this point in the history
…404 page #13102 #15369

 - Merge Pull Request #15369 from Ananth747/magento2:Ananth747-patch-1
 - Merged commits:
   1. a1d0e3b
   2. b81bf67
   3. b0848c4
   4. f5bd1c6
  • Loading branch information
magento-engcom-team committed Aug 14, 2018
2 parents 33d39af + f5bd1c6 commit 38f7daa
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 38f7daa

Please sign in to comment.