Form API checkboxes type does not honor return value in options array
ccourtne - October 28, 2005 - 14:56
| Project: | Drupal |
| Version: | x.y.z |
| Component: | base system |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
According to the checkboxes documentation the options array should be in the format of [return_value] = choice, but the expand check boxes was not properly setting the return_value option. Patch is attached to correct this.
| Attachment | Size |
|---|---|
| checkboxes_2.patch | 815 bytes |

#1
Could this one get reviewed by some Forms API peeps? I have a sneaking suspicion that a bug in the implementation of checkboxes is causing all manner of problems and bugs in many different parts of Drupal... most notably, theme settings.
(I would have a look myself, but I'm afraid I'm quite pissed.)
#2
I've been experiencing some problems with a patch to menu.module that might be related to this as well -- if a return value and a default value are specified for a checkbox, it seems to ALWAYS return the default value even if the checkbox is unchecked. Odd stuff.
#3
checkboxes code has been give a throrough overhaul by chx. this bug is dead.
#4
Agreed.
#5
Oops, not really. Just talked to chx in IRC. He said to reroll. Here it is.
#6
#7
same patch with the -p option applied during the diff per chx's recommendation.
#8
Committed to HEAD. Thanks.
#9