module-blog
module-blog copied to clipboard
Massdelete deletes all blogs when search has 1 result
Steps to reproduce
- Go to All Posts
- Use search so you have 1 result
- check the blog and choose Delete
Expected result:
- only 1 blog item deleted
Actual result:
- all blog items deleted
Fix in https://github.com/mirasvit/module-blog/pull/213
@lrgmirasvit could you merge this PR https://github.com/mirasvit/module-blog/pull/213 ?
@PascalBrouwers Thank you for submitting this fix. We'll check the fix and will merge this pull request after all the checks.
@PascalBrouwers @lrgmirasvit I tested this fix but unfortunately I'm still able to reproduce the issue in the following way:
- Open the blog listing in admin
- Search by keyword in such a way that one blog post is listed
- Select the listed blog post by checking the checkbox
- Select the Delete action from the mass-action drop-down
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.
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.
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.