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

Specifying a custom identifier_field is considered invalid. #1874

Closed
rogermparent opened this issue Nov 12, 2018 · 0 comments · Fixed by #1882
Closed

Specifying a custom identifier_field is considered invalid. #1874

rogermparent opened this issue Nov 12, 2018 · 0 comments · Fixed by #1882

Comments

@rogermparent
Copy link

rogermparent commented Nov 12, 2018

Describe the bug

Attempting to use the identifier_field feature introduced in 2.2.0 causes the schema error: 'collections[0]' must have a field that is a valid entry identifier

To Reproduce

  1. Attempt to load Netlify CMS with the attached config.

Expected behavior

The CMS loads without throwing an error.

Applicable Versions:

  • Netlify CMS version: 2.2.0
  • Git provider: test repo
  • OS: Linux
  • Browser version: Firefox 63.0.1 / Chromium 70.0.3538.77
  • Node.JS version: 11.1.0

CMS configuration

backend:
  name: test-repo

display_url: https://example.com

publish_mode: editorial_workflow
media_folder: assets/uploads

collections: # A list of collections the CMS should be able to edit
  - label: "Blog"
    name: "blog"
    folder: "_posts/blog"
    create: true
    identifier_field: name
    fields:
      - {label: "Name", name: "name", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Featured Image", name: "thumbnail", widget: "image"}
      - {label: "Body", name: "body", widget: "markdown"}

Additional context
The problem seems to lie in netlify-cms-core/src/constants/configSchema.js because manually adding "name" to the hard-coded identifier fields allows the CMS to load, but I haven't tested anything beyond that.

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