U4-11474 - Umbraco.TrueFalse prevalue of true is not being stored in database

Created by Joshua Pease 21 Jun 2018, 21:47:07 Updated by Sebastiaan Janssen 25 Jun 2018, 06:24:58

Tags: PR

In Umbraco 7.11 the updated Umbraco.TrueFalse property editor is not storing it's default value in the database.

$scope.model.value is only set when $scope.toggle() is called (after clicking the toggle.

'''What did you do?'''

Create a new Umbraco.TrueFalse proprety editor with the default value set to true (checked).

Create a new node that uses this property editor.

Save the new node without toggling the property editor.

'''What did you expect to happen?'''

I would expect that the property editor would have a value of true (or 1).

'''What actually happened?'''

It appears that no value is saved to the database. This happens no matter if the default is set to true or false.

When using the following code,

@foreach(var prop in Model.Content.Properties)
        <div>@prop.PropertyTypeAlias: @prop.DataValue :: @prop.Value</div>

I get the following:

testTrueFalse: :: False

Once I click the property editor on that node and save/publish. I get this:

testTrueFalse: 1 :: True

or `

testTrueFalse: 0 :: False`

if you set your checkbox to off.

I'll be submitting a PR shortly with a fix by modifying booleanEditorController() in boolean.controller.js


Dave Woestenborghs 22 Jun 2018, 06:51:47

PR : https://github.com/umbraco/Umbraco-CMS/pull/2717

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Very Easy

Category: UI

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.11.0

Due in version: 7.11.1


Story Points: