- Do you want to request a feature or report a bug?
Bug
- What is the current behavior?
Boolean Field Doesn't Save Default Value, Rather Skips Property Altogether.
- If the current behavior is a bug, please provide the steps to reproduce.
Please use this code inside an object
- {label: "Show Rating For Featured", name: "show-rating", widget: "boolean", default: false}
- What is the expected behavior?
should return default value,
show-rating: false
- Please mention your versions where applicable.
Netlify CMS version: 1.6
Browser version:
Node.JS version:
Operating System:
- Please link or paste your config.yml below if applicable.
https://github.com/moonlandingnetwork/moonlandingnetwork.github.io/blob/master/admin/config.yml
(Edit by @tech4him1 to format code.)
We've had requests on this before to not save if the field was optional -- just something to consider when fixing.
If not much trouble, Can this be addressed soon, Most of the logic on website depends on the Boolean property being true or false.
@siliconchild Feel free to submit a PR!
I can't reproduce this, the false value is output in the yaml string whether set by default and untouched or toggled to false.
collections:
- name: "coins"
label: "Coins"
editor:
preview: false
folder: _coins
create: true
extension: html
format: frontmatter
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "coindetail"}
- {label: "Title", name: "title", widget: "string"}
- {label: "Meta Description", name: "metadesc", widget: "string", required: false }
- {label: "Meta Keywords", name: "metakeywords", widget: "string", required: false}
- label: "Date Added"
name: "date-added"
widget: "date"
default:
- name: "ico"
label: "Basic ICO Listing Information"
widget: object
fields:
- {label: "Cancelled", name: "cancelled", widget: "boolean", default: false}
- {label: "ICO Name", name: "name", widget: "string" }
- {label: "Token Name", name: "token-name", widget: "string" }
- {label: "Logo", name: "logo", widget: "image", required: false}
- {label: "Category", name: "category", widget: "string", required: false }
- {label: "Two Word Description", name: "shortdesc", widget: "string",required: false }
- {label: "Featured", name: "featured", widget: "boolean", default: false}
- label: "Featured Till"
name: "featured-till"
widget: "date"
default: ""
- {label: "Show Rating For Featured", name: "show-rating", widget: "boolean", default: false}
- {label: "Top Banner Advert", name: "topbanner", widget: "boolean", default: false }
- {label: "Top Banner Advert Blurb", name: "topbanner-content", widget: "string", required: false }
- {label: "Video Link", name: "video", widget: "string", required: false }
- {label: "Whitepaper Link", name: "whitepaper", widget: "string", required: false }
- {label: "Crowdsale Link", name: "crowdsale", widget: "string", required: false }
- {label: "Main Description", name: "desc", widget: "text", required: false }
- name: "tags"
label: "Tags"
widget: list
required: false
fields:
- {label: "Tag", name: "tag", widget: "string"}
- {label: "ICO Rating", name: "moonability", widget: "string", required: false }
- name: "whitelist"
label: "Whitelist Informtaion"
widget: object
fields:
- {label: "Whitelist Present", name: "status", widget: "boolean", default: false}
- name: "type"
label: "Whitelist Type"
widget: select
options:
- { label: "Whitelist", value: "Whitelist" }
- { label: "Whitelist + KYC", value: "Whitelist + KYC" }
- {label: "Date Not Announced", name: "no-date", widget: "boolean", default: false }
- label: "Whitelist Start Date"
name: "start-date"
widget: "date"
default: ""
- label: "Whitelist End Date"
name: "end-date"
widget: "date"
default: ""
- name: "token"
label: "Token Meta Information"
widget: object
fields:
- {label: "Token Type", name: "type", widget: "string", required: false }
- {label: "Project Location", name: "location", widget: "string", required: false }
- label: "Announced Date"
name: "announced"
widget: "date"
default: ""
- name: "progress"
label: "ICO Progress"
widget: object
fields:
- label: "Fundraising Goal"
name: "total"
widget: "number"
default: 0
valueType: "int"
- label: "Collected"
name: "collected"
widget: "number"
default: 0
valueType: "int"
- name: "pre-ico"
label: "Pre ICO Information"
widget: object
fields:
- {label: "Date Not Announced", name: "no-date", widget: "boolean", default: false }
- label: "Pre ICO Start Date"
name: "start-date"
widget: "date"
default: ""
- label: "Pre ICO End Date"
name: "end-date"
widget: "date"
default: ""
- name: "mvp"
label: "MVP"
widget: select
default: "Not Available"
options:
- { label: "Yes", value: "Yes" }
- { label: "No", value: "No" }
- { label: "Alpha", value: "Alpha" }
- {label: "Soft Cap", name: "soft-cap", widget: "string", required: false }
- {label: "Hard Cap", name: "hard-cap", widget: "string", required: false }
- name: "contribution-size"
label: "Contribution Size"
widget: object
fields:
- {label: "Minimum Contribution Value in USD", name: "usd", widget: "string", required: false }
- {label: "Minimum Contribution Value in ETH", name: "eth", widget: "string", required: false }
- name: "conversion"
label: "Conversion"
widget: object
fields:
- {label: "Token Value in USD", name: "usd", widget: "string", required: false }
- {label: "Token Value in ETH", name: "eth", widget: "string", required: false }
- {label: "Token Value in BTC", name: "btc", widget: "string", required: false }
- {label: "Token Transferability", name: "token-issue", widget: "string", required: false }
- {label: "Pre ICO Bonus", name: "pre-ico-bonus", widget: "string", required: false }
- name: "ico-detail"
label: "ICO Information"
widget: object
fields:
- {label: "Date Not Announced", name: "no-date", widget: "boolean", default: false }
- label: "ICO Start Date"
name: "start-date"
widget: "date"
default: ""
- label: "ICO End Date"
name: "end-date"
widget: "date"
default: ""
- name: "mvp"
label: "MVP"
widget: select
default: "Not Available"
options:
- { label: "Yes", value: "Yes" }
- { label: "No", value: "No" }
- { label: "Alpha", value: "Alpha" }
- {label: "Soft Cap", name: "soft-cap", widget: "string", required: false }
- {label: "Hard Cap", name: "hard-cap", widget: "string", required: false }
- name: "contribution-size"
label: "Contribution Size"
widget: object
fields:
- {label: "Minimum Contribution Value in USD", name: "usd", widget: "string", required: false }
- {label: "Minimum Contribution Value in ETH", name: "eth", widget: "string", required: false }
- {label: "Total Supply", name: "total-supply", widget: "string", required: false }
- {label: "Investor Supply", name: "investor-supply", widget: "string", required: false }
- name: "supply-distribution"
label: "Supply Distribution"
widget: list
fields:
- {label: "Name and Value. (eg, Core team: 10%)", name: "distribution-item", widget: "string", required: false }
- name: "conversion"
label: "Conversion"
widget: object
fields:
- {label: "Token Value in USD", name: "usd", widget: "string", required: false }
- {label: "Token Value in ETH", name: "eth", widget: "string", required: false }
- {label: "Token Value in BTC", name: "btc", widget: "string", required: false }
- {label: "Token Transferability", name: "token-issue", widget: "string", required: false }
- {label: "ICO Bonus", name: "bonus", widget: "string", required: false }
- name: "team"
label: "Team Information"
widget: list
required: false
fields:
- {label: "Name", name: "name", widget: "string", required: false}
- {label: "Display Picture", name: "image", widget: "image", required: false }
- {label: "Position", name: "position", widget: "string", required: false }
- {label: "Linkedin Profile", name: "linkedin", widget: "string",required: false }
- name: "social"
label: "ICO Website & Social Links"
widget: object
required: false
fields:
- {label: "Website", name: "website", widget: "string", required: false }
- {label: "Facebook", name: "facebook", widget: "string", required: false }
- {label: "Twitter", name: "twitter", widget: "string", required: false }
- {label: "Telegram", name: "telegram", widget: "string", required: false }
- {label: "Medium", name: "medium", widget: "string", required: false }
- name: "ico-participation-details"
label: "ICO Participation Terms"
widget: object
required: false
fields:
- name: "currencies-accepted"
label: "Currencies Accepted"
widget: list
fields:
- {label: "Currency", name: "currency", widget: "string" ,required: false }
- name: "countries-notallowed"
label: "Countries Not Allowed"
widget: list
fields:
- {label: "Country", name: "country", widget: "string",required: false }
- {label: "Input Twitter Username to Display Feed", name: "twitter-username", widget: "string", required: false }
This is the config that creates the issue, could you try reproducing with this
@erquhart this issue already fixed in #1826
Thanks @barthc - sent you a collaborator invite so you can close issues yourself (and merge PR's, just make sure there's consensus where necessary). Thanks for all your help!
@erquhart thank you so much. I already accepted the invite :+1:
Most helpful comment
Thanks @barthc - sent you a collaborator invite so you can close issues yourself (and merge PR's, just make sure there's consensus where necessary). Thanks for all your help!