diff --git a/core/includes/common.inc b/core/includes/common.inc index 4668a90..2e0e5a3 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -5216,8 +5216,8 @@ function drupal_render(&$elements) { // that the $element or the children can be altered or corrected before the // element is rendered into the final text. if (isset($elements['#pre_render'])) { - foreach ($elements['#pre_render'] as $function) { - $elements = $function($elements); + foreach ($elements['#pre_render'] as $callable) { + $elements = call_user_func($callable, $elements); } } @@ -5284,8 +5284,8 @@ function drupal_render(&$elements) { // content is sent to the browser. The changes are made on $content // which allows the output'ed text to be filtered. if (isset($elements['#post_render'])) { - foreach ($elements['#post_render'] as $function) { - $elements['#children'] = $function($elements['#children'], $elements); + foreach ($elements['#post_render'] as $callable) { + $elements['#children'] = call_user_func($callable, $elements['#children'], $elements); } } diff --git a/core/includes/form.inc b/core/includes/form.inc index 2f930e2..8bcc8aa 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -1750,7 +1750,7 @@ function form_error(&$element, $message = '') { * adds the attributes and JavaScript needed to make the details work in older * browsers. The #process functions are called in preorder traversal, meaning * they are called for the parent element first, then for the child elements. - * - $element['#after_build']: An array of functions called after form_builder() + * - $element['#after_build']: An array of callables called after form_builder() * is done with its processing of the element. These are called in postorder * traversal, meaning they are called for the child elements first, then for * the parent element. @@ -1939,8 +1939,8 @@ function form_builder($form_id, &$element, &$form_state) { // The #after_build flag allows any piece of a form to be altered // after normal input parsing has been completed. if (isset($element['#after_build']) && !isset($element['#after_build_done'])) { - foreach ($element['#after_build'] as $function) { - $element = $function($element, $form_state); + foreach ($element['#after_build'] as $callable) { + $element = call_user_func_array($callable, array($element, &$form_state)); } $element['#after_build_done'] = TRUE; } diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 5360a83..bfeb61d 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -282,8 +282,8 @@ function hook_queue_info_alter(&$queues) { * - "#validate": array of callback functions taking $form and $form_state. * - "#element_validate": array of callback functions taking $element and * $form_state. - * - "#pre_render": array of callback functions taking $element and $form_state. - * - "#post_render": array of callback functions taking $element and $form_state. + * - "#pre_render": array of callables taking $element. + * - "#post_render": array of callback functions taking $children and $element. * - "#submit": array of callback functions taking $form and $form_state. * - "#title_display": optional string indicating if and how #title should be * displayed, see theme_form_element() and theme_form_element_label().