--- includes/common.inc?rev=1.431 2005-03-28 18:27:01.000000000 +0200
+++ includes/common.inc 2005-03-28 19:36:38.000000000 +0200
@@ -413,6 +413,18 @@ function fix_gpc_magic() {
}
}
+function fix_checkboxes() {
+ static $fixed = false;
+ if (!$fixed && array_key_exists('form_checkboxes', $_POST)) {
+ foreach ($_POST['form_checkboxes'] as $key) {
+ if (!array_key_exists($key, $_POST['edit'])) {
+ $_POST['edit'][$key] = array();
+ }
+ }
+ $fixed = true;
+ }
+}
+
/**
* @name Conversion
* @{
@@ -1182,9 +1194,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 '' . 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) {