Follow-up patch for #3996: If a boolean field is configured and saved, a non-ticked checkbox is saved as NULL value by propel, because symfony applies NULL as default value for empty boolean values.
The problem here is that propel on the other hand only converts non-null values to boolean values, sample code of a generated BaseObject?:
public function setFoo($v)
{
if ($v !== null) {
$v = (boolean) $v;
}
if ($this->foo !== $v || $v === false) {
$this->foo = $v;
$this->modifiedColumns[] = FooPeer::FOO;
}
return $this;
} // setFoo()
Now I don't know if I should blame propel or symfony for this (IMHO its already wrong that the propel guys allow three values for the boolean, i.e. a tri-state type with true, false or null, while people actually expect a boolean to be only a two-state value type) - I still have attached a patch which sets an explicit empty_value as default value for boolean fields in symfony. If there is another way of "overriding" the default behaviour and too many people expect the default value being NULL, then please correct me...