Error when searching for ID and drafts enabled
@PatrikKozak is already working on this.
Since Feb 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Describe the Bug
Using the PostgresSql adapter, the list view crashes on my collection:
- a collection with versions and drafts enabled
- listSearchableFields with ID and another field e.g.
listSearchableFields: ['id', 'title'] - search for a non-numeric value
The error that is given is
error: invalid input syntax for type integer: "NaN"
The part of the query that causes the error:
("_posts_v"."parent_id" = $6 or "_posts_v"."version_title" ilike $7) where the 6th parameter is "NaN".
Link to the code that reproduces this issue
https://github.com/snakemastr/payload_reproduction_versions_id
Reproduction Steps
- Create a collection
- Add a text field 'title'
- Enable versions with drafts
- Set admin.listSearchableFields = ['id', 'title']
- Add a document to the collection
- try to search the document on title with a non-numeric value
Which area(s) are affected?
db: postgres
Environment Info
Payload: 3.68.3
Node: 22.19.0
Next.js: 15.5.9
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
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.
More from payloadcms/payload
-
area: ui Bug status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
payloadcms/payload#18215 · 1 comment ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
payloadcms/payload#18163 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
payloadcms/payload#18161 ·
-
area: core Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
payloadcms/payload#18072 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
payloadcms/payload#18067 · 1 comment ·
All issues in payloadcms/payload
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·