[eluser]JonoB[/eluser]
[quote author="Icehawg" date="1300662519"]Actually, I started getting the "in_array" error (posted above) with a single checkbox form so I did a little more digging and changed line 1737 from:
Code:
$this->$element->atts['checked'] = ($checked && in_array($this->$element->value, $checked)) ? TRUE : FALSE;
to:
Code:
$this->$element->atts['checked'] = ($checked && in_array($this->$element->value, $this->_make_array($checked))) ? TRUE : FALSE;
Also the
select elements were getting the [ ]'s appended to their names even if only
one value was selected. So, locally, I removed that and I add the [ ] myself to the name parameter. Not sure if this is a bug, or intentional, but I don't mind adding them in when creating the form->select options.
Thanks again.[/quote]
Yep, I got the same error too. I fixed it as follows:
From
Code:
case 'checkbox':
case 'radio':
$checked = set_value($name);
$this->$element->atts['checked'] = ($checked && in_array($this->$element->value, $checked)) ? TRUE : FALSE;
break;
To
Code:
case 'checkbox':
case 'radio':
$checked = set_value($name);
$test = TRUE;
if (is_array($checked))
{
$test = in_array($this->$element->value, $checked) ? TRUE : FALSE;
}
$this->$element->atts['checked'] = ($checked && $test) ? TRUE : FALSE;
break;