Umbraco toggle configuratin values stored in database differently depending on how datatype was created
Does anyone know why toggle values are stored differently in umbracoDataType table depending on how datatype was created?
When I create new datatype using toggle property editor "Initial State" and "Show toggle labels" config values are stored as true/false:
But when I create custom property editor with boolean prevalues (part of package manifest below):
"prevalues": {
"fields": [
{
"label": "Key auto generated",
"description": "If checked then key will be auto generated as camel case value",
"hideLabel": false,
"key": "keyAutoGenerated",
"view": "boolean"
}
]
}
Then datatype created using this propery editor saves boolean values as 0/1 :
I came across this because I have custom plugin that allows to create toggle definition. This definition saves configuration with 0/1 values instead of true/false. It creates problems with showing toggle labels - button is generated with show-labels="1" configuration (as saved in database), and Angular condition for showing labels is:
This kind of issue wasn't present in v7, because boolean property editor had slighty different definition for show labels config (Umbraco\Views\propertyeditors\boolean\boolean.html):
v8:
I don't want to create bug report yet, as I'm not sure if it was intendend change or not.
But to be honest getting back to v7 solution would make it less prone to issues caused by different storing format of boolean values in database ;)
Umbraco toggle configuratin values stored in database differently depending on how datatype was created
Does anyone know why toggle values are stored differently in umbracoDataType table depending on how datatype was created?
When I create new datatype using toggle property editor "Initial State" and "Show toggle labels" config values are stored as true/false: But when I create custom property editor with boolean prevalues (part of package manifest below):
Then datatype created using this propery editor saves boolean values as 0/1 :
I came across this because I have custom plugin that allows to create toggle definition. This definition saves configuration with 0/1 values instead of true/false. It creates problems with showing toggle labels - button is generated with show-labels="1" configuration (as saved in database), and Angular condition for showing labels is:
This kind of issue wasn't present in v7, because boolean property editor had slighty different definition for show labels config (Umbraco\Views\propertyeditors\boolean\boolean.html): v8:
v7:
I don't want to create bug report yet, as I'm not sure if it was intendend change or not. But to be honest getting back to v7 solution would make it less prone to issues caused by different storing format of boolean values in database ;)
is working on a reply...