A field in a table may have NULL values (that is even more important since now every field must have a default value so for numerical fields NULL is fundamental, since 0 is wrong and empty is not a number).
Now when the user edit an object and wants to remove the value of a numeric field, in a point of the process the form is sent to the bind function in "libraries/src/Table/Table.php", that replaces the values currently stored in the DB with the new values coming from the form.
The problem is that if a field has a new value of "null" we have 2 options:
if(isset($src[$k]))
Why filtering OUT null values? Is it a sort of a protection for special situations that we need to keep or can we remove it? Currently extensions cannot ask Joomla to save a NULL value.
Or checking if the field is NULLable from the field properties in the DB?
thanks
Labels |
Added:
No Code Attached Yet
|
yes, thanks Nicola. The issues arises when editing an existing object that has a non null value and you want to set it to null, the isset() check discard the binding for that value. I see that a solution was proposed but we were waiting for a "major" release, maybe 4.4? I dont think there is a severe backward problem with it, what do you think?
Labels |
Added:
bug
|
sorry if I misunderstood
but with this snippet i'm unable to reproduce
checked_out is updated to NULL as expected