Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Delete" function deletes more than what's selected when using "Select all" #6326

Open
DrMint opened this issue May 12, 2024 · 0 comments
Open
Labels
[possible-bug] Possible bug which hasn't been reproduced yet

Comments

@DrMint
Copy link

DrMint commented May 12, 2024

Link to reproduction

No response

Describe the Bug

I wanted to delete a subset of all entries in a upload collection: the filenames starting with some prefix. There were hundreds of matching entries so I used the "Select all" function on the top right to select all entries (not only the entries on the current page). It is my understanding that this should select all matching entries, not simply ALL entries... and the number of selected entries after clicking on this function seems to reflect that.

Despite selecting only a subset of all entries in a collection, and despite the deletion confirmation modal displaying the right amount of selected entries, the deletion process actually deletes more entries than expected (all entries in this case).

To Reproduce

2024-05-12-10.57.36.333559401.mp4

(It seems the video fails to load on Firefox... please try on a Chromium-based browser)

  • Create multiple entries in a collection (here, 2 entries in the Scan collection)
  • Use filters or the search function to get a subset of all the entries (here, 1 entry that contains the substring "1").
  • Use the "Select all X [name of the collection]" to select all entries matching our search
  • Click on the Delete button
  • The "Confirm deletion" modal also reports the right amount of entries to be deleted.
  • After confirming, the success toast at the bottom indicates that ALL entries have been deleted.

Notes

I've tested other cases such as:

  • Manually selecting some subset using the checkboxes in each entry's row.
  • Selected a subset using the checkbox in the header of the table (which selects all entries in the current page)

In both cases, the right amount of element were deleted when I used the Delete function. It seems the problem only arise when using the "Select all X [name of the collection]" button.

Payload Version

2.16.1

Adapters and Plugins

"@payloadcms/bundler-webpack": "1.0.6", "@payloadcms/db-mongodb": "1.5.1", "@payloadcms/richtext-lexical": "0.10.0"

@DrMint DrMint added the [possible-bug] Possible bug which hasn't been reproduced yet label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[possible-bug] Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant