Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Massdelete deletes all blogs when search has 1 result #212

Open
PascalBrouwers opened this issue Jan 26, 2021 · 6 comments
Open

Massdelete deletes all blogs when search has 1 result #212

PascalBrouwers opened this issue Jan 26, 2021 · 6 comments
Labels

Comments

@PascalBrouwers
Copy link

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
@PascalBrouwers
Copy link
Author

Fix in #213

@PascalBrouwers
Copy link
Author

@lrgmirasvit could you merge this PR #213 ?

@lrgmirasvit
Copy link
Contributor

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

@stefangranit
Copy link

@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.

@PascalBrouwers
Copy link
Author

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
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants