0

There is an issue encounter while using mass delete functionality at the catalog product. I am using Magento 2.2.2 setup. Steps to replicate this issue: - Select multiple products and submit delete action. - Refresh the product list page open at another browser or another PC with the same or different admin account. It will delete all the products of your store. I fell prey two times.

Please help me to avoid this.

0

This is a known bug on Magento. Please see here https://github.com/magento/magento2/issues/19533

You need to rewrite the following classes via preference

Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php
Magento/Ui/Component/MassAction/Filter.php 

And apply the code changes found in this commit https://github.com/magento/magento2/commit/7028b311c05

0

I got solution. I know that this is not reliable but it works for me. I made changes in Massdelete controller.

$count = count($collection); // newly added
foreach ($collection as $product) {
$this->productRepository->delete($product);
$productDeleted++;
if($count == $productDeleted){break;} // newly added
}

And now i am going to override this controller. And Looking forward to correct answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.