Due to the regression in #811542: Regression: Required radios throw illegal choice error when none selected, required radio buttons fail to validate properly. After that patch is applied, they should work in general, but the 'radios' Option Widget still does not work.

This is because the options widget is incorrectly setting #default_value to FALSE instead of NULL in some circumstances.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

loganfsmyth’s picture

Status: Active » Needs review
FileSize
720 bytes

This changes it, so that when there is selected default value, the #default_value property is properly set to NULL, instead of the result of reset(), which was FALSE.

Again, this needs to be applied along with the patch in #811542: Regression: Required radios throw illegal choice error when none selected, at the moment in comment #70.

pillarsdotnet’s picture

Status: Needs review » Closed (duplicate)
loganfsmyth’s picture

That makes sense :)

pillarsdotnet’s picture

Status: Closed (duplicate) » Needs work

Un-marking as dup, because this causes a test to fail and I don't want to hold up the other issue on that account.

loganfsmyth’s picture

Status: Needs work » Needs review
FileSize
1.38 KB

Here's a new patch that passes the tests, but I don't know if it really addresses the underlying issues.

The last test failed because, now that the 'radios' element has a null value, #value == '' of each underlying 'radio' element. This is hitting problems because it uses == to compare, so things with return_values of 0 will turn out 'checked'.

loganfsmyth’s picture

Thinking on it more, this might be a better solution.

#type 'radio' is more specifically boolean, so it makes more sense to specify default_value FALSE if it shouldn't be checked.

loganfsmyth’s picture

Status: Needs review » Active

Removing 'needs review' because I have a new patch over at #811542: Regression: Required radios throw illegal choice error when none selected that includes the patch from comment 6.

pillarsdotnet’s picture

Status: Active » Closed (duplicate)

In that case, this should be closed.

loganfsmyth’s picture

I guess. I didn't want to fully close it until I'd heard some kind of response in the other issue...