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.
Currently you can choose a select list as a widget for a Boolean.
That is because we currently cannot limit cardinality per field-type. That means a boolean can have any number of values, in which case it makes sense to have a select list, but ...
...then it's not a Boolean anymore!
Therefore, IMO we should just hide that option from people, because it really doesn't make any sense.
People who want to make super-crazy-multi-value-boolean-fields can do a hook_widget_info_alter() anyway, so it's not really that big of a deal. But it really confused me, when I saw it.
Comment | File | Size | Author |
---|---|---|---|
boolean-vs-list.patch | 1.2 KB | tstoeckler | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedCompletely agree.
+ 'default_widget' => 'options_buttons',
buttons?
Comment #2
tstoecklerI guess that name was chosen (not by me!) because it can be either radios or checkboxes, so buttons is sort of neutral. I guess.
http://api.drupal.org/api/function/options_field_widget_info/7
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedok thx.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.