I have created a Publish field in several tables. I used the Publish wizard. I also set the default value to 1.
In the backend i have created an item form and put the Publish field into the form.
Now when i save an item with the Publish radiobox to No it will save a value 1 (Yes).
The reason is in the code in the table class check() function:
if (empty($this->publish))
$this->publish = "1";
When you look at the return values of the php empty function a zero is considered as empty:
Returns FALSE if var has a non-empty and non-zero value.
The following things are considered to be empty:
"" (an empty string)
0 (0 as an integer)
0.0 (0 as a float)
"0" (0 as a string)
NULL
FALSE
array() (an empty array)
var $var; (a variable declared, but without a value in a class)
I think in case of a boolean the check with empty(value) is not correct because 0 is the No value!