I have a form that gets values set in the variable table if any have been submitted. All of the fields work as expected except a radios field, which always shows the default. Here's the relevant code
$one = variable_get('one', array());
$form['one']['visibility'] = array(
'#type' => 'radios',
'#title' => t('The title'),
'#options' => array(0 => t('Yes'), 1 => t('No')),
'#default_value' => (!empty($one['visibility']))
? $one['visibility']
: 1,
);
I had thought that keying the options array with strings would solve this but it doesn't. I'm still Googling, but I'm wondering if there's something easy I'm missing.