It doesn't seem possible to set "0" as the default value for checkboxes:

- Pull out a checkboxes field.
- Check customize keys. Set the first option to have a key of 0
- Try to select this first option as a default.
- The live preview will not check the first box, nor will the first option as the default save in the component configuration.

CommentFileSizeAuthor
#1 options_element_zero_default.patch1017 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Project: Form Builder » Options Element
Version: 7.x-1.x-dev » 7.x-1.4
Component: Webform Itegration » Code
Status: Active » Needs review
FileSize
1017 bytes

Looks like this bug is in Options Element rather than Form Builder.

quicksketch’s picture

Status: Needs review » Fixed

The patch is pretty simple, looks like a classic case of checking for a value where "0" should be allowed, but is discarded because it evaluates to FALSE. Considering #1198142: Elements with #default_value of FALSE can't have their default value edited again (breaks Webform integration), we actually may want to allow FALSE as a default value, so this approach uses checking against NULL. Committed to both branches.

Status: Fixed » Closed (fixed)

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