diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php index 096551b..5167238 100644 --- a/core/lib/Drupal/Core/Render/Renderer.php +++ b/core/lib/Drupal/Core/Render/Renderer.php @@ -165,6 +165,17 @@ protected function doRender(&$elements, $is_root_call = FALSE) { return ''; } + if (isset($elements['#render_children']) && empty($elements['#children']) && $elements['#theme'] != 'page') { + $children_keys = Element::children($elements); + $output = ''; + foreach ($children_keys as $key) { + if (!empty($elements[$key])) { + $output .= $this->doRender($elements[$key]); + } + } + return $output; + } + // Do not print elements twice. if (!empty($elements['#printed'])) { return ''; @@ -293,9 +304,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) { } // Call the element's #theme function if it is set. Then any children of the - // element have to be rendered there. If the internal #render_children - // property is set, do not call the #theme function to prevent infinite - // recursion. + // element have to be rendered there. if ($theme_is_implemented && !isset($elements['#render_children'])) { $elements['#children'] = $this->theme->render($elements['#theme'], $elements);