I found out that for empty integer fields (that are optional of
course) Cake tries to save an empty string instead of NULL. I have to
handle this in Model::beforeSave() like:
if ($this-data[$this-name]['number'] === '') unset($this-data[$this-
name]['number']);
And so the empty string becomes
I think in cases like this an optional numeric field containing an
empty string should be marked as an invalid field so it would be
easier to debug, or it should be typecasted or omitted...
--~--~-~--~~~---~--~~
You received this message because you are subscribed