File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
app/code/Magento/Review/Controller/Product Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
6
7
namespace Magento \Review \Controller \Product ;
7
8
8
- use Magento \Framework \Exception \LocalizedException ;
9
+ use Magento \Framework \App \ResponseInterface ;
10
+ use Magento \Framework \Controller \ResultInterface ;
11
+ use Magento \Framework \View \Result \Layout ;
9
12
use Magento \Review \Controller \Product as ProductController ;
10
13
use Magento \Framework \Controller \ResultFactory ;
11
14
@@ -14,17 +17,16 @@ class ListAjax extends ProductController
14
17
/**
15
18
* Show list of product's reviews
16
19
*
17
- * @return \Magento\Framework\View\Result\ Layout
20
+ * @return ResponseInterface|ResultInterface| Layout
18
21
*/
19
22
public function execute ()
20
23
{
21
24
if (!$ this ->initProduct ()) {
22
- throw new LocalizedException (__ ("The product can't be initialized. " ));
23
- } else {
24
- /** @var \Magento\Framework\View\Result\Layout $resultLayout */
25
- $ resultLayout = $ this ->resultFactory ->create (ResultFactory::TYPE_LAYOUT );
25
+ /** @var \Magento\Framework\Controller\Result\Forward $resultForward */
26
+ $ resultForward = $ this ->resultFactory ->create (ResultFactory::TYPE_FORWARD );
27
+ return $ resultForward ->forward ('noroute ' );
26
28
}
27
29
28
- return $ resultLayout ;
30
+ return $ this -> resultFactory -> create (ResultFactory:: TYPE_LAYOUT ) ;
29
31
}
30
32
}
You can’t perform that action at this time.
0 commit comments