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

Add new from Join Field does not honor default or conditions #9081

Open
nathanclevenger opened this issue Nov 8, 2024 · 3 comments
Open

Comments

@nathanclevenger
Copy link
Contributor

Describe the Bug

Add new from Join Field:
Image

Create new from Collection:
Image

export const Resources: CollectionConfig = {
  slug: 'resources',
  fields: [
    { name: 'id', type: 'text', required: true },
    { type: 'row', fields: [
      { name: 'type', type: 'select', options: ['data', 'content'], required: true, defaultValue: 'data' },
      { name: 'dataset', type: 'relationship', relationTo: 'datasets', required: true },
    ]},
    { name: 'markdown', type: 'code', admin: { language: 'markdown', condition: data => data.type === 'content' } },
    { name: 'data', type: 'json', required: true },
  ],
}

Link to the code that reproduces this issue

https://github.com/nathanclevenger/payload-repro/blob/main/collections/Resources.ts

Reproduction Steps

In this example, select Add new for Resources from within a detail view of an item in the Datasets collection, and the default and condition behavior is not honored, like it is if you create a new Resource directly from the Collection Create New

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

area: ui

Environment Info

Payload: 3.0.0-beta.126
Node: v20.13.1
Next: 15.0.0

@akhrarovsaid
Copy link
Contributor

Hey @nathanclevenger I believe this is a possible duplicate of #8612

@nathanclevenger
Copy link
Contributor Author

ahh @akhrarovsaid I didn't see the other ticket in my search because I initially noticed that condition wasn't honored, and then I noticed default wasn't working either when I was making the repro ... does the PR to fix #8612 also fix condition?

@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 11, 2024
@akhrarovsaid
Copy link
Contributor

Hey @nathanclevenger,

I'm not able to reproduce either the default values not populating, nor the condition issue as of beta.128. Want to try updating your Payload versions and seeing if you're still experiencing this issue?

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

No branches or pull requests

3 participants