generate and store UUID

Just a note to self ...

Line 1430, in main element model getValue() ..

$values = FArrayHelper::getValue($data, $name, $default);

So when editing, if the $data['foo___bar'] is there but undefined (i.e. was NULL in table), it'll pick up the default.

We should probably YAFO this behavior, as it may or may not be desired.

-- hugh
 
thanks for clarification...for my usecase it?s very convenient to have default value applied to existing data (only if stored vallue = NULL)
 
Yup, and I'm certainly not going to just "fix" it. Although it's accidental, I think I know when it started happening, which was a while back, and "fixing" it now would probably break quite a few sites that now rely on the accidental behavior.

I think what I'll do is add a global option to control the behavior, "Apply defaults if NULL", which defaults to true, so it doesn't break backward compatibility, but can be turned off.

-- hugh
 
One remark (as it is at the moment):
If the user doesn't have add access the default IS applied to new records (which is surely necessary)
If the user doesn't have edit access (really no edit access, not only element set to "Readonly") the default is NOT applied to those NULL fields (but the field is empty after save, not longer NULL)
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top