Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localized group Field breaks Postgres #8308

Closed
italodr opened this issue Sep 19, 2024 · 3 comments
Closed

Localized group Field breaks Postgres #8308

italodr opened this issue Sep 19, 2024 · 3 comments
Assignees
Labels

Comments

@italodr
Copy link

italodr commented Sep 19, 2024

Link to reproduction

https://github.com/italodr/test-payload-19092024

Environment Info

Binaries:
  Node: 20.12.2
  npm: 10.5.0
  Yarn: 1.22.22
  pnpm: 9.1.2
Relevant Packages:
  payload: 3.0.0-beta.107
  next: 15.0.0-canary.104
  @payloadcms/db-postgres: 3.0.0-beta.107
  @payloadcms/email-nodemailer: 3.0.0-beta.107
  @payloadcms/graphql: 3.0.0-beta.107
  @payloadcms/next/utilities: 3.0.0-beta.107
  @payloadcms/plugin-cloud: 3.0.0-beta.107
  @payloadcms/richtext-lexical: 3.0.0-beta.107
  @payloadcms/translations: 3.0.0-beta.107
  @payloadcms/ui/shared: 3.0.0-beta.107
  react: 19.0.0-rc-06d0b89e-20240801
  react-dom: 19.0.0-rc-06d0b89e-20240801
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:52:31 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11

Describe the Bug

I am trying to create a collection with some fields. When I add a field of type upload, there is no problem. But if I try to put this field inside a field of type group, the terminal stops with the following error:

ERROR: Error: cannot connect to Postgres: Cannot read properties of undefined (reading 'notNull')

Screenshot 2024-09-19 at 16 25 15

Reproduction Steps

To reproduce the bug:

  1. Clone the repository
  2. Run dev script
  3. Open: http://localhost:3000/admin
  4. Check the console

To verify that it works if it is applied to the field instead of to the group:

  1. Go to src > globals > header.ts
  2. Move line 16 inside the upload field config
  3. Run dev script
  4. Open: http://localhost:3000/admin

The reproduction repository has been created with:

npx create-payload-app@beta

And the following configuration has been added to payload.config.ts file:

{
  ...
  localization: {
    locales: [
      { code: 'de', label: 'Deutsch' },
      { code: 'es', label: 'Español' },
    ],
    defaultLocale: 'de',
    fallback: false,
  },
  globals: [Header],
  ...
}

Adapters and Plugins

db-postgres

@italodr italodr added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Sep 19, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Sep 20, 2024
@r1tsuu
Copy link
Member

r1tsuu commented Sep 22, 2024

Hey @italodr, thank you! Fix is here: #8355, should be in the next release.

@r1tsuu r1tsuu closed this as completed Sep 22, 2024
Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2024
DanRibbens pushed a commit that referenced this issue Sep 23, 2024
…8355)

This PR addresses these issues with localized groups / tabs with
Postgres / SQLite:

- Array fields inside of localized groups. Fixes
#8322
- Select fields with `hasMany: true` inside of localized groups. Related
to 1, but still needed its own additional logic.
- Relationship (non-polymorphic / non has-many) inside of localized
groups. Previously, even just trying to define them in the config led to
a crash. Fixes #8308

Ensures test coverage for localized groups.
Copy link

🚀 This is included in version v3.0.0-beta.109

@github-actions github-actions bot unlocked this conversation Sep 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants