Skip to content

Boolean widget with false value not rendered in MD #4726

@logemann

Description

@logemann

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions