You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a node using the ContentService the default value of the boolean property editor isn't applied.
Specifics
When content is created in the back end the values for the boolean property editor are empty. Content created in the front end sees no value on the model and applies the default based on the config but content created in the back end never sees the angular controller.
Since the angular controller is setting the value of the property editor when the content is loaded it appears as if the default value is set to True (the checkbox is checked and there is no green + icon indicating a saved draft) but until you save and publish from the content tree the value is still empty and rendered as false in views.
I created a forum post when I first came across it with images of what I was experiencing but after looking into it a bit more I think it's a bug.
This seems related to #6252 but occuring when content is created in the back end not when a property editor is added to existing content.
Steps to reproduce
Create a document type with an Umbraco.TrueFalse property editor and set the default value to true.
Create a new IContent node of your document type using the Create method of the ContentService.
SaveAndPublish created node
Expected result
I expected the default values to be set, if not possible I'd expect the content in the back office to reflect the value that's rendered to views.
Actual result
No values were set but the created node in the content tree appears to set up correctly.
The text was updated successfully, but these errors were encountered:
Yeah so this is how it works - setting "default value" to "true" only tells the AngularJs when the page loads: if this checkbox has no value (null), then set it to true in the UI.
Indeed, this default value is not wired up in the ContentService which could be considered a bug. However, this setting was really not implemented in the way we would like it to be implemented (and we would like to have a better way to be able to set "default" or "initial" values for all property editors where it makes sense (#7859). So for now: you are responsible for setting the default to true yourself if you create items using the ContentService and in the future we hopefully have a robust system for doing this automatically.
Umbraco version
I am seeing this issue on Umbraco version: 8.6.3
Bug summary
When creating a node using the ContentService the default value of the boolean property editor isn't applied.
Specifics
When content is created in the back end the values for the boolean property editor are empty. Content created in the front end sees no value on the model and applies the default based on the config but content created in the back end never sees the angular controller.
Since the angular controller is setting the value of the property editor when the content is loaded it appears as if the default value is set to True (the checkbox is checked and there is no green + icon indicating a saved draft) but until you save and publish from the content tree the value is still empty and rendered as false in views.
I created a forum post when I first came across it with images of what I was experiencing but after looking into it a bit more I think it's a bug.
This seems related to #6252 but occuring when content is created in the back end not when a property editor is added to existing content.
Steps to reproduce
Expected result
I expected the default values to be set, if not possible I'd expect the content in the back office to reflect the value that's rendered to views.
Actual result
No values were set but the created node in the content tree appears to set up correctly.
The text was updated successfully, but these errors were encountered: