mirasvit / module-blog

Magento 2 Blog Extension
https://mirasvit.com/magento-2-extensions/blog.html
Open Software License 3.0
68 stars 48 forks source link

Massdelete deletes all blogs when search has 1 result #212

Open PascalBrouwers opened 3 years ago

PascalBrouwers commented 3 years ago

Steps to reproduce

Expected result:

Actual result:

PascalBrouwers commented 3 years ago

Fix in https://github.com/mirasvit/module-blog/pull/213

PascalBrouwers commented 3 years ago

@lrgmirasvit could you merge this PR https://github.com/mirasvit/module-blog/pull/213 ?

lrgmirasvit commented 3 years ago

@PascalBrouwers Thank you for submitting this fix. We'll check the fix and will merge this pull request after all the checks.

stefangranit commented 3 years ago

@PascalBrouwers @lrgmirasvit I tested this fix but unfortunately I'm still able to reproduce the issue in the following way:

I have not been able to reproduce the issue if I do a search using the filter dialog. As a temporary work-around I ended up adding a check to the mass delete controller so it will refuse to delete any blog posts if the collection contains more than one blog post.

PascalBrouwers commented 3 years ago

How is that a workaround? Now it's a bug that no blog posts gets deleted when you have 1 result from the search. My fix works, no idea why you can't reproduce it.

stefangranit commented 3 years ago

True, safety-net is maybe a better term than workaround. I just needed to get a safety-net in place quickly as we do not want to end up with all blog posts getting deleted again by mistake. We have several hundreds of those and the information in those are critical in our case.

We're on Magento Commerce 2.4.1, and we updated the blog module early December last year. For some reason the fix did not help in our case. We'll have a look at this again later when we're on Magento 2.4.2.