payloadcms / payloadcms/payload

QueryPresets: UI breaks when you have saved a preset with a not_in filter on a relationship

Open
#16,614 0 comments 0 reactions 1 assignee View on GitHub

@jacobsfletch is already working on this.

Since May 18, 2026.

area: ui created-by: Contributor v3
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

If you have saved a query preset containing a "not_in" filter on a relationship, clicking the query preset selector results in a blank screen.

The failing method is the toWords in formatLabels.
It expects a string, and it seems like the "string" sent to the method in this specific case in the id of the related collection.

The toWords should in some way guard for non-string input (otherwise the UI blows up).

Also it seems that the label method in the query preset list does not take into account to look up the collection titles. The query filter saved in the db saves the id's only, so the titles of the collections should be looked up.

Please note that the query presets are COMPLETELY UNUSABLE if you get into this problem. I has to delete all the presets in my db to make it usable again.

Link to the code that reproduces this issue

https://github.com/re-cph/payload/tree/20260514_query_preset_notin_error

Reproduction Steps

I have made a simple relation (has many between Posts and Categories.

  • Navigate to the "Posts" list.
  • Apply a new filter: "Categories" -> "is not in" -> "Select one or more categories"
  • The filters apply correctly to the content
  • Create a new preset with the applied filter
  • After successful creation, try to open the preset selection list
  • The UI blows up and the screen is blank (or showing the error in development)
Which area(s) are affected?

area: ui

Environment Info
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  payload: 3.84.1
  next: 15.5.15
  @payloadcms/db-postgres: 3.84.1
  @payloadcms/drizzle: 3.84.1
  @payloadcms/email-nodemailer: 3.84.1
  @payloadcms/graphql: 3.84.1
  @payloadcms/next/utilities: 3.84.1
  @payloadcms/plugin-import-export: 3.84.1
  @payloadcms/richtext-lexical: 3.84.1
  @payloadcms/translations: 3.84.1
  @payloadcms/ui/shared: 3.84.1
  react: 19.1.1
  react-dom: 19.1.1
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:40 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.