payload icon indicating copy to clipboard operation
payload copied to clipboard

Add new from Join Field does not honor default or conditions

Open nathanclevenger opened this issue 3 months ago • 3 comments

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

nathanclevenger avatar Nov 08 '24 07:11 nathanclevenger