Skip to content

Default value on file collection string field fails #4363

@mikestopcontinues

Description

@mikestopcontinues

Describe the bug

I have a string field with a default value on a file in a file collection that doesn't get populated, while an identical config works in a folder collection.

To Reproduce

{
collections: [{
  name: 'main',
  label: 'Main Pages',
  singular_label: 'Page',
  preview_path: '{{fields.slug}}',
  format: 'yaml-frontmatter',
  editor: {preview: false},
  create: false,
  delete: false,
  files: [{
    label: 'Home',
    name: 'home',
    file: `content/page/home.md`,
    fields: [
      {label: 'Title', name: 'title', widget: 'string', default: 'Home'},
    ],
  }],
}]
}

Expected behavior

I expect the default value to apply.

Applicable Versions:

Most recent everything.

Additional context

I'm manually initializing, and doing my config in JS.

Metadata

Metadata

Assignees

No one assigned

    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