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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Status: Active » Fixed

True. 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

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

liquidcms’s picture

Status: Closed (fixed) » Active

can 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.

Agileware’s picture

Status: Active » Needs review
FileSize
2.11 KB

Here is a patch that fixes this problem from the current 5.x-1.x-dev

Agileware’s picture

Status: Needs review » Needs work

The patch in #4 causes problems with userreference fields.
Empty userreference fields are getting zero instead of NULL, which is not good.

Agileware’s picture

Version: 6.x-2.0-beta » 5.x-1.x-dev

This is a problem when using a numeric cck field that is not required and can have a database value of NULL.

Agileware’s picture

Status: Needs work » Needs review
FileSize
1.41 KB

Here is a proper patch that, unlike the one in #4, works :)

KarenS’s picture

Status: Needs review » Closed (won't fix)

The D5 version is no longer being supported. Sorry.