diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-11-28 16:37:11 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-11-28 16:37:11 +0000 |
commit | 63a78a617bfa85bfc973ab00eeb0abe657a7aafc (patch) | |
tree | 4cb4c650461730c9a7fa821cb28fb10473892117 | |
parent | 56f054c42980c9a28d085734edea64002d80758e (diff) | |
download | brdo-63a78a617bfa85bfc973ab00eeb0abe657a7aafc.tar.gz brdo-63a78a617bfa85bfc973ab00eeb0abe657a7aafc.tar.bz2 |
- Patch #38038: hook_elements override instead of merge.
-rw-r--r-- | includes/form.inc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/includes/form.inc b/includes/form.inc index 3d0a18ec7..7e8e387af 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -286,8 +286,17 @@ function _form_builder($form_id, $form) { } // Allow for elements to expand to multiple elements. Radios, checkboxes and files for instance. - if (function_exists($form['#process']) && !$form['#processed']) { - $form = call_user_func($form['#process'], $form); + if (isset($form['#process']) && !$form['#processed']) { + if (is_array($form['#process'])) { + foreach ($form['#process'] as $process) { + if (function_exists($process)) { + $form = call_user_func($process, $form); + } + } + } + elseif (function_exists($form['#process'])) { + $form = call_user_func($form['#process'], $form); + } $form['#processed'] = TRUE; } @@ -410,12 +419,12 @@ function _element_info($type, $refresh = null) { foreach (module_implements('elements') as $module) { $elements = module_invoke($module, 'elements'); if (is_array($elements)) { - $cache = array_merge($cache, $elements); + $cache = array_merge_recursive($cache, $elements); } } if (sizeof($cache)) { foreach ($cache as $element_type => $info) { - $cache[$element_type] = array_merge($basic_defaults, $info); + $cache[$element_type] = array_merge_recursive($basic_defaults, $info); } } } |