Default values for fields are not set and they get published when added to existing content-types.
w
wiktorg
Hi! We're trying to enhance our single-type with new fields. I added necessary fields to our Single Type, marked them as required (in my case boolean and single component) and set default values for both of them (tab advanced in field configuration).
I set false for the boolean and I expected the component to already be there without the need to click the button and create it manually since I marked it as required.
Single Type was already published, so they appeared in it's view.
I triggered build for our frontend application and got error that aforementioned fields are non-nullable.
We use Strapi's Graphql API.
When I went to the Single Type editor and manually filled required fields - build was successful.
Without filling them I couldn't save changes, but that behavior is expected.
I think if fields have default values they should be there from the beginning grin
S
Sascha Kycia
Yes, this can be very painful when you have e.g 50 pages and multiple languages and you have to introduce a new field for a common component. You end up editing pretty much every component in every page.
O
Oliver
Any progress on this strapi team? I'm having the same issues months on!