Radio elements' #return_value attributes do not need to be run through check_plain() in form_process_radios(), since the attribute is ultimately output by drupal_attributes(), which runs all attribute data through check_plain() itself.
This messes up any javascript that looks at form element values--probably #states and definitely ctools form dependencies (#958608: Dependendcy does not work with option "<=").
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 971120.patch | 4.1 KB | bojanz |
| #7 | 971120.patch | 3.58 KB | bojanz |
| #5 | 971120-5-radio_values.patch | 2.96 KB | dawehner |
| #4 | 971120-4-radio_values.patch | 1.24 KB | becw |
| #2 | 971120-2-radio_values.patch | 1.21 KB | becw |
Comments
Comment #2
becw commentedChecking for actual equivalency this time...
Comment #4
becw commentedAbsolute equivalency wasn't the issue--need to check whether the element has a value or not. Thx simpletest!
Comment #5
dawehnerHere is patch with a test. But sadly this testcase in general fails here, let's see what the testbot says.
Comment #6
bojanz commentedThe test without the fix fails, as it should.
Let's see if the testbot is still happy with the patch.
#5: 971120-5-radio_values.patch queued for re-testing.
Comment #7
bojanz commentedGreat, the bot still likes it!
Rerolled anyway, adding commas at the end of newly added array elements, and eliminating the offsets while I'm at it.
+1 for RTBC.
Comment #8
bojanz commentedchx pointed me to #954628: "An illegal choice has been detected" when a radio/checkbox option key contains a quote character.
The fix for radio buttons in that issue is the same one as the one in this patch, except that this patch also has tests.
Before that issue can be closed and this one committed, we need to see what should be done with checkboxes, since they might have a similar bug of their own.
Comment #9
bojanz commentedMarked #954628: "An illegal choice has been detected" when a radio/checkbox option key contains a quote character as duplicate, we can now continue here.
So, RTBC? Anyone?
Comment #10
bojanz commentedIncreasing priority, would be really good to fix this before the release since it affects Views.
Comment #11
bojanz commentedchx reviewed the patch on IRC, requested more comments. Added.
Comment #12
chx commentedLooks good to me.
Comment #13
webchickCommitted to HEAD. Thanks!