payloadcms/payload

Regression: Inline create drawer uses relationship field name as path for nested fields

Closed this issue · 2 comments

Describe the Bug

When using a relationship with allowCreate: true to an auth-enabled collection, the inline create drawer renders the EmailField (or TextField if username is enabled) with the wrong name attribute. Instead of name="email", it inherits the relationship field’s name (e.g. author). This breaks form submission because the email value isn’t bound to the correct field. The regression started after #11973

Link to the code that reproduces this issue

https://github.com/jonathanelmgren/payload-inline-create-field-path-bug

Reproduction Steps

  1. Create a users collection with auth: true.

  2. Create a posts collection with a relationship to users:

    {
      name: 'author',
      type: 'relationship',
      relationTo: 'users',
      hasMany: true,
      allowCreate: true,
    }
  3. In the Admin UI, go to Posts → Create.

  4. Click the + button in the relationship field to create a user inline.

  5. Observe the email input in the drawer.

Expected: name="email"
Actual: name="author"

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

area: ui

Environment Info

Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 1.22.19
  pnpm: 9.7.1
Relevant Packages:
  payload: 3.55.0
  next: 15.4.4
  @payloadcms/db-mongodb: 3.55.0
  @payloadcms/email-nodemailer: 3.55.0
  @payloadcms/graphql: 3.55.0
  @payloadcms/next/utilities: 3.55.0
  @payloadcms/payload-cloud: 3.55.0
  @payloadcms/richtext-lexical: 3.55.0
  @payloadcms/translations: 3.55.0
  @payloadcms/ui/shared: 3.55.0
  react: 19.1.0
  react-dom: 19.1.1
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 10

🚀 This is included in version v3.56.0

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