--- includes/common.inc?rev=1.431 2005-03-28 18:27:01.000000000 +0200 +++ includes/common.inc 2005-03-28 18:28:09.000000000 +0200 @@ -413,6 +413,20 @@ function fix_gpc_magic() { } } +function _fix_checkboxes($key) { + if (empty($_POST['edit'][$key])) { + $_POST['edit'][$key] = array(); + } +} + +function fix_checkboxes() { + static $fixed = false; + if (!$fixed && array_key_exists('edit', $_POST) && array_key_exists('_form_checkboxes', $_POST['edit'])) { + array_map('_fix_checkboxes', $_POST['edit']['_form_checkboxes']); + $fixed = true; + } +} + /** * @name Conversion * @{ @@ -1182,9 +1196,8 @@ function form_checkboxes($title, $name, $choices .= '
'; } // Note: because unchecked boxes are not included in the POST data, we - // include a form_hidden() which will be overwritten as soon as there is at - // least one checked box. - return form_hidden($name, 0) . theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name)); + // indicate that $name is a form_checkbox. + return form_hidden($name, 0). form_hidden('_form_checkboxes][', $name). theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name)); } } --- index.php?rev=1.82 2005-03-28 18:28:46.000000000 +0200 +++ index.php 2005-03-28 18:23:17.000000000 +0200 @@ -14,6 +14,7 @@ include_once 'includes/common.inc'; fix_gpc_magic(); +fix_checkboxes(); $status = menu_execute_active_handler(); switch ($status) {