Commit b538ba87 authored by Steven Wittens's avatar Steven Wittens
Browse files

#60370: #theme callback on element broken

parent 83e279a7
......@@ -498,13 +498,21 @@ function form_render(&$elements) {
uasort($elements, "_form_sort");
if (!isset($elements['#children'])) {
/* render all the children using a theme function */
/* Render all the children that use a theme function */
if (isset($elements['#theme']) && !$elements['#theme_used']) {
$elements['#theme_used'] = TRUE;
$previous_value = $elements['#value'];
$previous_type = $elements['#type'];
$elements['#value'] = '';
$elements['#type'] = 'markup';
$content = theme($elements['#theme'], $elements);
$elements['#value'] = $previous_value;
$elements['#type'] = $previous_type;
unset($elements['#prefix'], $elements['#suffix']);
}
/* render each of the children using form_render and concatenate them */
if (!$content) {
......
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