magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Mass delete deletes all products #15935

Closed patrick-bigbridge closed 4 years ago

patrick-bigbridge commented 6 years ago

On the product page, if you select "Delete" twice, all products will be removed.

Preconditions

  1. Magento 2.1.11 & 2.3.x EE & 2.3.x CE(2.3-develop too)
  2. Have some products (e.g. 10)
  3. Created products with name&sku test 1, test 1-2, test 1-2-3

    Steps to reproduce

  4. Go to backend, Products / Catalog
  5. Make a selection of some product (using a Search by keyword with 'test 1' value) and select checkbox(for 'select all' option)
  6. Select action "Delete"
  7. Click "OK" in the confirmation popup
  8. At this point do not wait until Magento is done, but while it is still running, do:
  9. Select action "Delete" again
  10. Click "OK" in the confirmation popup

Magento's request will run for a long time(in case with a lot of products). If you check the database (select(count(*) from catalog_product_entity), you will see that the number of products keeps decreasing.

Expected result

I expect that Magento either disables user input while deleting products, or that is keeps its selection until after the products are deleted.

Actual result

All products deleted. GIF(testing scenario): Peek 2019-10-08 15-07

hostep commented 4 years ago

It was mentioned above that it was fixed in Magento 2.3.4

Has anybody seen it occurring on 2.3.4 or higher?

pedrohenrique1986 commented 4 years ago

I think until magento fixes this issue, you can remove mass delete action from product grid, mass actions list. And add delete option at product row level.

he problem occurs when you try to delete 1 pipeline, but click twice on the delete button. In my case it's not related to mass exclusion

novikor commented 4 years ago

Hi, @pedroohsolucoes. Could you, please, provide more detailed steps to reproduce?

pedrohenrique1986 commented 4 years ago

yes, there is even a gif showing the error

https://user-images.githubusercontent.com/51680850/66394471-e6c19000-e9dd-11e9-841b-7f6e61d93228.gif

sawwd commented 3 years ago

I can confirm this issue was fixed in 2.4. Also, if you are below this version please compare with 2.4 branch and check if the changes from below commits are present. If not, make sure you overwrite them via a plugin.

https://github.com/magento/magento2/commit/ab769ad412470244e9d3694bfea58479afa0332a https://github.com/magento/magento2/commit/87dff07de468c103dfe546d8c43769673e4f548d

This issue is not so easy to reproduce because the speed of the server is an important factor. For example, I searched for something and then I checked Select All (to select all entries filtered) then I confirm I want to delete those but quickly while those entries was processed I have tried again to delete them and all entries were deleted. For those who can't reproduce only with the mouse cursor because the server response is very fast you can use the ENTER keyboard to confirm the deletion.

I hope this helps you.