Skip to content

Commit d23cf29

Browse files
author
Roman Leshchenko
committed
MAGETWO-92175: Wrong product grid behavior in admin panel
1 parent e8f34de commit d23cf29

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Ui\Component\MassAction\Filter;
1212
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
1313
use Magento\Catalog\Api\ProductRepositoryInterface;
14+
use Magento\Framework\Exception\NotFoundException;
1415

1516
class MassDelete extends \Magento\Catalog\Controller\Adminhtml\Product
1617
{
@@ -54,9 +55,15 @@ public function __construct(
5455

5556
/**
5657
* @return \Magento\Backend\Model\View\Result\Redirect
58+
* @throws NotFoundException
59+
* @throws \Magento\Framework\Exception\LocalizedException
60+
* @throws \Magento\Framework\Exception\StateException
5761
*/
5862
public function execute()
5963
{
64+
if (!$this->getRequest()->isPost()) {
65+
throw new NotFoundException(__('Page not found'));
66+
}
6067
$collection = $this->filter->getCollection($this->collectionFactory->create());
6168
$productDeleted = 0;
6269
/** @var \Magento\Catalog\Model\Product $product */

0 commit comments

Comments
 (0)