Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit b81bf67

Browse files
committed
Fixed review list ajax if product not exist redirect to 404 page #13102 #2
1 parent a1d0e3b commit b81bf67

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
<?php
2-
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
5-
*/
6-
namespace Magento\Review\Controller\Product;
7-
8-
use Magento\Framework\Exception\LocalizedException;
9-
use Magento\Review\Controller\Product as ProductController;
10-
use Magento\Framework\Controller\ResultFactory;
11-
12-
class ListAjax extends ProductController
13-
{
14-
/**
15-
* Show list of product's reviews
16-
*
17-
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Layout
18-
*/
19-
public function execute()
20-
{
21-
if (!$this->initProduct()) {
22-
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */
23-
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD);
24-
$resultForward->forward('noroute');
25-
return $resultForward;
26-
} else {
27-
/** @var \Magento\Framework\View\Result\Layout $resultLayout */
28-
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
29-
}
30-
31-
return $resultLayout;
32-
}
33-
}
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Review\Controller\Product;
7+
8+
use Magento\Framework\Exception\LocalizedException;
9+
use Magento\Review\Controller\Product as ProductController;
10+
use Magento\Framework\Controller\ResultFactory;
11+
12+
class ListAjax extends ProductController
13+
{
14+
/**
15+
* Show list of product's reviews
16+
*
17+
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Layout
18+
*/
19+
public function execute()
20+
{
21+
if (!$this->initProduct()) {
22+
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */
23+
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD);
24+
$resultForward->forward('noroute');
25+
return $resultForward;
26+
} else {
27+
/** @var \Magento\Framework\View\Result\Layout $resultLayout */
28+
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
29+
}
30+
31+
return $resultLayout;
32+
}
33+
}

0 commit comments

Comments
 (0)