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

Boolean widget with false value not rendered in MD #4726

Open
logemann opened this issue Dec 14, 2020 · 1 comment
Open

Boolean widget with false value not rendered in MD #4726

logemann opened this issue Dec 14, 2020 · 1 comment
Labels
type: bug code to address defects in shipped code

Comments

@logemann
Copy link

Describe the bug
When setting a Boolean widget to false, this key wont be rendered to the resulting Frontmatter/Markdown file with key: false but will be left out completely. This makes problems with Gatsby GraphQL queries where this field is part of the query.

To Reproduce
define boolean field like so:
- {label: "Featured Post", name: "featuredpost", widget: "boolean", required: false}

resulting MD file doesnt have the frontmatter key "featuredpost" included.

Expected behavior
a file like this gets generated:

---
templateKey: single-blog-post
title: My super blog post
featuredpost: false
---
Super Blog content

Applicable Versions:

  • netlify-cms-app 2.14.5
  • netlify-cms-core 2.36.4
  • Github

CMS configuration
not disclosed

@logemann logemann added the type: bug code to address defects in shipped code label Dec 14, 2020
@ivanreese
Copy link

Also running into this issue, but with a YAML file rather than MD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants