fixed not working checkboxes after r31472

This commit is contained in:
Ralf Becker 2010-07-22 13:09:33 +00:00
parent 8ef7201027
commit b9bfd285a5

View File

@ -2248,12 +2248,12 @@ class etemplate extends boetemplate
self::set_array($content,$form_name,$value);
break;
case 'checkbox':
if (!$value)
if (!$value && $attr['needed'])
{
self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),'');
}
if ($value === false)
{
if ($attr['needed'])
{
self::set_validation_error($form_name,lang('Field must not be empty !!!',$value),'');
}
self::set_array($content,$form_name,$attr['multiple'] ? array() : $attr['unset_value']); // need to be reported too
}
else