payloadcms / payloadcms/payload
Product documents are not appearing in Admin Trash view when trash: true is enabled
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
Product documents are not appearing in Admin Trash view when trash: true is enabled
Describe the Bug
When trash: true is enabled on the Products collection, deleting a Product from the Payload Admin Panel appears to complete successfully, but the deleted Product does not appear in the collection's Trash view.
The Admin Panel shows:
No Products in trash
Environment
- Payload CMS:
3.88.0 - Database: MongoDB
- Next.js:
16.3.3 - Collection:
products
Steps to Reproduce
- Enable
trash: trueon theProductscollection. - Create a Product.
- Open the Product in the Payload Admin Panel.
- Delete the Product.
- Open the Products collection's Trash view.
Expected Behavior
The deleted Product should be soft-deleted and appear in:
/collections/products/trash
The Product should have a deletedAt timestamp and should be available for:
- Restore
- Permanent Delete
Actual Behavior
The Product disappears from the normal Products list, but the Trash view shows:
No Products in trash
Additional Investigation
A trashed Product can be checked with:
const result = await payload.find({
collection: 'products',
trash: true,
where: {
deletedAt: {
exists: true,
},
},
})
console.log(result.docs)
If the deleted Product appears in this query but not in the Admin Trash view, the issue appears to be related to the Admin Trash UI/query.
If the Product does not appear here either, the soft-delete operation may not be setting deletedAt correctly.
References
Payload Trash documentation:
https://payloadcms.com/docs/trash/overview
Link to the code that reproduces this issue
pnpx create-payload-app@latest -t ecommerch
Reproduction Steps
Acctuay Trash system is not working bro
Which area(s) are affected?
area: ui
Environment Info
DE_OPTIONS=--no-deprecation payload "info"
Binaries:
Node: 24.15.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
payload: 3.88.0
next: 16.3.3
@payloadcms/db-mongodb: 3.88.0
@payloadcms/email-nodemailer: 3.88.0
@payloadcms/graphql: 3.88.0
@payloadcms/live-preview: 3.88.0
@payloadcms/live-preview-react: 3.88.0
@payloadcms/next/utilities: 3.88.0
@payloadcms/plugin-cloud-storage: 3.89.0
@payloadcms/plugin-form-builder: 3.88.0
@payloadcms/plugin-seo: 3.88.0
@payloadcms/richtext-lexical: 3.88.0
@payloadcms/translations: 3.88.0
@payloadcms/ui/shared: 3.88.0
react: 19.2.6
react-dom: 19.2.6
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 24237
Available CPU cores: 12
PS E:\01-utmeducation-com>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the ecommerch app and inspect the Products Admin Trash view at /collections/products/trash. First run the payload.find query with trash: true and deletedAt to determine whether the document is soft-deleted or only missing from the UI. Done means deleted Products appear in Trash with restore and permanent-delete actions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, nextjs, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100