Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
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).
(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.
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
https://github.com/payloadcms/payload/assets/29893320/396384a6-243f-45a0-b68d-31ab24ccef95
(It seems the video fails to load on Firefox... please try on a Chromium-based browser)
Notes
I've tested other cases such as:
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"