forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed review list ajax if product not exist redirect to 404 page mage…
- Loading branch information
1 parent
a1d0e3b
commit b81bf67
Showing
1 changed file
with
33 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Review\Controller\Product; | ||
|
||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Review\Controller\Product as ProductController; | ||
use Magento\Framework\Controller\ResultFactory; | ||
|
||
class ListAjax extends ProductController | ||
{ | ||
/** | ||
* Show list of product's reviews | ||
* | ||
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Layout | ||
*/ | ||
public function execute() | ||
{ | ||
if (!$this->initProduct()) { | ||
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */ | ||
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD); | ||
$resultForward->forward('noroute'); | ||
return $resultForward; | ||
} else { | ||
/** @var \Magento\Framework\View\Result\Layout $resultLayout */ | ||
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT); | ||
} | ||
|
||
return $resultLayout; | ||
} | ||
} | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Review\Controller\Product; | ||
|
||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Review\Controller\Product as ProductController; | ||
use Magento\Framework\Controller\ResultFactory; | ||
|
||
class ListAjax extends ProductController | ||
{ | ||
/** | ||
* Show list of product's reviews | ||
* | ||
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Layout | ||
*/ | ||
public function execute() | ||
{ | ||
if (!$this->initProduct()) { | ||
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */ | ||
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD); | ||
$resultForward->forward('noroute'); | ||
return $resultForward; | ||
} else { | ||
/** @var \Magento\Framework\View\Result\Layout $resultLayout */ | ||
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT); | ||
} | ||
|
||
return $resultLayout; | ||
} | ||
} |