Commit f8fa114a authored by Dries's avatar Dries

- Patch #67439 by sun, effulgentsia: #tree in hook_element_info() does not work.

parent 9bab7f62
......@@ -1291,6 +1291,13 @@ function form_builder($form_id, $element, &$form_state) {
// Recurse through all child elements.
$count = 0;
foreach (element_children($element) as $key) {
// Prior to checking properties of child elements, their default properties
// need to be loaded.
if (isset($element[$key]['#type']) && empty($element[$key]['#defaults_loaded']) && ($info = element_info($element[$key]['#type']))) {
$element[$key] += $info;
$element[$key]['#defaults_loaded'] = TRUE;
}
// Don't squash an existing tree value.
if (!isset($element[$key]['#tree'])) {
$element[$key]['#tree'] = $element['#tree'];
......@@ -1312,12 +1319,6 @@ function form_builder($form_id, $element, &$form_state) {
$array_parents[] = $key;
$element[$key]['#array_parents'] = $array_parents;
// Prior to handling #weight, default element properties need to be applied.
if (isset($element[$key]['#type']) && empty($element[$key]['#defaults_loaded']) && ($info = element_info($element[$key]['#type']))) {
$element[$key] += $info;
$element[$key]['#defaults_loaded'] = TRUE;
}
// Assign a decimal placeholder weight to preserve original array order.
if (!isset($element[$key]['#weight'])) {
$element[$key]['#weight'] = $count/1000;
......
......@@ -384,7 +384,6 @@ function system_element_info() {
);
$types['checkboxes'] = array(
'#input' => TRUE,
'#tree' => TRUE,
'#process' => array('form_process_checkboxes'),
'#theme_wrappers' => array('checkboxes'),
'#pre_render' => array('form_pre_render_conditional_form_element'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment