-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
- Do you want to request a feature or report a bug?
bug
- What is the current behavior?
String and markdown widgets that are empty produce different data values, depending on whether the field has been edited.
- If the current behavior is a bug, please provide the steps to reproduce.
- Define a non-required string field in
config.yml
:
-
label: non-required string field
name: nonrequiredstring
widget: string
required: false
- Create a new item in the collection
- Don't touch the non-required string field at all
- Click Publish
Observe that the nonrequiredstring
field isn't in the frontmatter of the resulting markdown file.
- Create a new item in the collection
- Enter some text in the non-required string field, then delete the text again so the field is blank
- Click Publish
Observe that frontmatter of the resulting markdown file contains nonrequiredstringfield: ''
- What is the expected behavior?
That the resulting value is the same in both cases, preferably undefined
.
The issue can also be observed for string
and markdown
widgets showing up in editor components. Also if you open an existing item, remove the text in a field, then Publish.
- Please mention your versions where applicable.
Netlify CMS version: 1.9.2
Browser version: Chrome 67.0.3396.87/OSX
Node.JS version: 10.4.1
Operating System: Mac OSX 10.13.5 (High Sierra)