Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: 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) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
liquidcms CreditAttribution: 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 CreditAttribution: Agileware commentedHere is a patch that fixes this problem from the current 5.x-1.x-dev
Comment #5
Agileware CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: Agileware commentedHere is a proper patch that, unlike the one in #4, works :)
Comment #8
KarenS CreditAttribution: KarenS commentedThe D5 version is no longer being supported. Sorry.