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.

AttachmentSize
checkboxes_2.patch815 bytes

#1

leafish_paul - October 28, 2005 - 23:48
Version:<none>» x.y.z

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

eaton - October 31, 2005 - 05:01

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

Steve Dondley - January 7, 2006 - 05:18

checkboxes code has been give a throrough overhaul by chx. this bug is dead.

#4

eaton - January 7, 2006 - 05:22
Status:needs review» fixed

Agreed.

#5

Steve Dondley - January 7, 2006 - 05:23

Oops, not really. Just talked to chx in IRC. He said to reroll. Here it is.

AttachmentSize
checkboxes_reroll.patch 824 bytes

#6

Steve Dondley - January 7, 2006 - 05:24
Status:fixed» needs review

#7

Steve Dondley - January 7, 2006 - 05:31

same patch with the -p option applied during the diff per chx's recommendation.

AttachmentSize
checkboxes_reroll_0.patch 866 bytes

#8

Dries - January 8, 2006 - 12:40
Status:needs review» fixed

Committed to HEAD. Thanks.

#9

ccourtne - January 10, 2006 - 23:34
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.