If the number zero is entered into a CCK field with the type number_integer, a NULL value is written into the database. There is no error message.
Since zero is a valid integer, a value of zero should be stored.
Using CCK 6.x-2.0-beta on Drupal 6.2.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | cck-int_field_allow_zero-271087-7.patch | 1.41 KB | agileware |
| #4 | cck-271087-4.patch | 2.11 KB | agileware |
Comments
Comment #1
yched commentedTrue. Classical quirk of PHP's empty() function. Similar problem existed for text fields (when entering '0' as a value). Additionally, same problem was present when *displaying* the '0' value once it had entered the database.
Should be fixed now in latest D6 branch. Thanks for reporting
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
liquidcms commentedcan i just hijack this and set it to Dr5? lol.. anyway.. this is busted as well in 5.x-1.9 let me know if i should mod info above or make a new ticket.
Comment #4
agileware commentedHere is a patch that fixes this problem from the current 5.x-1.x-dev
Comment #5
agileware commentedThe patch in #4 causes problems with userreference fields.
Empty userreference fields are getting zero instead of NULL, which is not good.
Comment #6
agileware commentedThis is a problem when using a numeric cck field that is not required and can have a database value of NULL.
Comment #7
agileware commentedHere is a proper patch that, unlike the one in #4, works :)
Comment #8
karens commentedThe D5 version is no longer being supported. Sorry.