Skip to content

join into localized array does not work #10356

Open
@Xiphe

Description

Describe the Bug

Hey lovely payload people <3

Given fields:

{
  name: 'section',
  localized: true,  // <--- toggle here
  type: 'array',
  fields: [
    {
      name: 'image',
      type: 'relationship',
      relationTo: 'media',
    },
  ],
}

The following join causes an error:

{
  name: 'usedIn',
  type: 'join',
  collection: 'posts',
  on: 'section.image',
}

Error:

InvalidFieldJoin: Invalid join field usedIn. The config does not have a field 'section.image' in collection 'posts'.

Link to the code that reproduces this issue

https://github.com/Xiphe/payload-join-localized-array/tree/localized-array-deep-join

Reproduction Steps

  1. check out https://github.com/Xiphe/payload-join-localized-array/tree/localized-array-deep-join
  2. run pnpm i
  3. run pnpm test:int _community
  4. see error
  5. remove localized: true from test/_community/collections/Posts/index.ts
  6. re-run pnpm test:int _community
  7. see no error

Which area(s) are affected? (Select all that apply)

Not sure

Environment Info

Sidenote: `pnpm payload info` produces ` ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "payload" not found`



Binaries:
  Node: 20.11.0
  npm: 10.2.4
  Yarn: N/A
  pnpm: 9.15.2
Relevant Packages:
  payload: 3.14.0
  next: 15.1.3
  @payloadcms/db-postgres: 3.14.0
  @payloadcms/live-preview-react: 3.14.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions