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
  • Loading branch information
Stanislav Idolov authored Aug 14, 2018
2 parents 5d47632 + 38f7daa commit 12ff548
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 12ff548

Please sign in to comment.