Opened 8 years ago
Closed 5 years ago
#40025 closed defect (bug) (invalid)
Customer checkbox control is checked when the default value is false.
Reported by: | gandham | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8 |
Component: | Customize | Keywords: | |
Focuses: | Cc: |
Description
If we set the default value of the setting as boolean false, not "false", checkbox on the customiser is checked.
If I set the default value to 0, it is working as expected.
Should a boolean false be treated as false?
Customiser saves the false value as 0 and true value as 1, when actually saving to the db.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
@gandham Please provide a standalone plugin with code that demonstrates the issue you're having.
From your screenshot, I see you have “flase” (a mispelling). In PHP, if you try to use
flase
you'll get:In other words, it converts
flase
into a string'flase'
and this would then be interpreted as booleantrue
, and result in the checkbox being checked.