Skip to content

SQL query error when fetching collection using the latest localization parameters #15248

@nathanbowang

Description

@nathanbowang

Describe the Bug

When using the new localizeStatus: true feature with drafts enabled, querying a collection that has a join field with draft: true and a locale parameter generates an invalid SQL query, causing PostgreSQL error: invalid reference to FROM-clause entry for table "_r_v".

Workarounds ( either will fix the test )

  • Comment out localizeStatus: true line
  • Change name to label in the tabs field (src/collections/Org.ts:17)
  • Comment out defaultSort in the related collection (src/collections/Repo.ts:5)

Link to the code that reproduces this issue

https://github.com/nathanbowang/payload-localization-issues

Reproduction Steps

Run the test in the repo

Image

Which area(s) are affected?

area: core

Environment Info

$ npx payload info

Binaries:
  Node: 24.11.1
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.25.0
Relevant Packages:
  payload: 3.72.0
  next: 15.4.10
  @payloadcms/db-postgres: 3.72.0
  @payloadcms/drizzle: 3.72.0
  @payloadcms/graphql: 3.72.0
  @payloadcms/next/utilities: 3.72.0
  @payloadcms/richtext-lexical: 3.72.0
  @payloadcms/translations: 3.72.0
  @payloadcms/ui/shared: 3.72.0
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu, 08 Jan 2026 10:03:06 +0000
  Available memory (MB): 31794
  Available CPU cores: 20
y

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreCore Payload functionalitystatus: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions