diff --git a/includes/common.inc b/includes/common.inc index d35a10d87b9cb971e444db681dc36cdd8c9d21d9..066e1840ab4751258859b1c68fdc788ff90bfc6c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1266,14 +1266,14 @@ function form_checkbox($title, $name, $value = 1, $checked = FALSE, $description */ function form_checkboxes($title, $name, $values, $options, $description = NULL, $attributes = NULL, $required = FALSE) { if (count($options) > 0) { - if (!isset($values)) { + if (!isset($values) || $values == 0) { $values = array(); } $choices = ''; foreach ($options as $key => $choice) { $choices .= '<label class="option"><input type="checkbox" class="form-checkbox" name="edit['. $name .'][]" value="'. $key .'"'. (in_array($key, $values) ? ' checked="checked"' : ''). drupal_attributes($attributes). ' /> '. $choice .'</label><br />'; } - return theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name)); + return form_hidden($name, 0) . theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name)); } }