If you use optionwidgets.module to define some radiobox-options for a number field (e.g. integer) and don't mark the field required, then a 'N/A' option is automatically added as the first option to the node-edit form of this field. So you have another option with the label 'N/A' and the value ''. This option should be the default selected one when you create a new instance of a node-type using this field.

The problem is: If you define '0' to be an allowed option, the 'N/A' option is not the default selected one anymore, but the '0' option is.
Example:
You define a number field (integer) to simulate a boolean. Therefore you define the following key|label pairs in the 'Allowed values list'-textfield of the field setup:

0|no
1|yes

Don't mark the field required. So looking at the database level you have three options: NULL - no value was defined, '0' - which means no/false, '1' - which means yes/true.
If you create a new instance of a content type using your new field, the 2nd option '0|no' is the default selected one.

I guess the reason is, that '' (NULL) and '0' are not distinguished when the pre-selected default option is determined. And if both ('' and 0) are option values of the same field, the last one in the option sequence/array is pre-selected as the default one.

I don't know if the same problem arises, when you setup your field to have multiple values (= checkboxes). I haven't tired it, yet.

Comments

karens’s picture

See related issue at http://drupal.org/node/111129.

karens’s picture

Status: Active » Closed (won't fix)

The D5 version is no longer being supported. Sorry.