Skip to content
Snippets Groups Projects
Commit 7f083e0c authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #35570 by ccourtne and Steve: forms API does not adhere #return_value for checkboxes.

parent 16e9b4d0
No related branches found
No related tags found
No related merge requests found
......@@ -755,7 +755,7 @@ function expand_checkboxes($element) {
}
foreach ($element['#options'] as $key => $choice) {
if (!isset($element[$key])) {
$element[$key] = array('#type' => 'checkbox', '#processed' => TRUE, '#title' => $choice, '#default_value' => isset($value[$key]), '#attributes' => $element['#attributes']);
$element[$key] = array('#type' => 'checkbox', '#processed' => TRUE, '#title' => $choice, '#return_value' => $key, '#default_value' => in_array($key, $value), '#attributes' => $element['#attributes']);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment