-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
Bugdb: postgres@payloadcms/db-postgres@payloadcms/db-postgresstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bugdb: postgres@payloadcms/db-postgres@payloadcms/db-postgresstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet