payloadcms / payloadcms/payload

Product documents are not appearing in Admin Trash view when trash: true is enabled

Open
#18,192 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: ui Bug invalid-reproduction status: needs-triage v3
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
  1. Enable trash: true on the Products collection.
  2. Create a Product.
  3. Open the Product in the Payload Admin Panel.
  4. Delete the Product.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.