You should care about empty strings. An empty string is not null, so SELECT ... WHERE col IS NULL; will return a different record set to SELECT ... WHERE col = ''; It will also effectively invalidates any NOT NULL constraints on your database - an empty string is not null.
~GreyCells On Apr 18, 11:13 pm, rtconner <[EMAIL PROTECTED]> wrote: > Good call GreyCells. Thanks. > > I dont care if DB has NULL or an empty string. So that will work in > this situation. > Still would like to see bug 2092 implemented though. > > On Apr 18, 3:43 pm, GreyCells <[EMAIL PROTECTED]> wrote: > > > A possible workaround is to unset any empty fields in > > beforeValidates() - validate will then ignore them if allowBlank is > > set. > > > However, there is a conflict if you're also using beforeValidates() to > > set blank fields to null (so they are null rather than an empty string > > in the database) - depends if you're a pedantic db developer or not :) > > > ~GreyCells. > > > On Apr 18, 10:18 pm, rtconner <[EMAIL PROTECTED]> wrote: > > > > Wow did you pick an ambiguous name for that then. Holy misleading > > > batman. > > > > So how the heck do I do what I want to do? I can't help but think > > > enhancement/bug # 2092 is a "must have". I can't even think of a > > > workaround at the moment. > > > > On Apr 18, 3:05 pm, nate <[EMAIL PROTECTED]> wrote: > > > > > It technically means "allowNotPresent" as in "not present in the array > > > > of data to be saved", but I felt that was too cumbersome. > > > > > rtconner wrote: > > > > > Hello, (in 1.2) does anyone know what the intended behavior of > > > > > alowEmpty should be in the validate array in a model? > > > > > > You would think it would set the behavior to allow you to submit an > > > > > empty string that passes validation. For example, you may either pass > > > > > a valid phone number, or not send one at all. This was 'asdasda' does > > > > > not count as a phone number, but the phone number is not a required > > > > > field also. > > > > > > ..but this is not the behavior I am seeing. As far as I can tell > > > > > allowEmpty does nothing to change the behavior. Actually I looked at > > > > > the code in model and yes the code does not implement this behavior > > > > > either. I'm trying to determine if this is a bug or not. > > > > > > So... how should allowEmpty cause things to behave? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
