Skip to content
Snippets Groups Projects
Commit 72d13bc3 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #295506 by swentel: node preview is rendered twice.

parent c639b513
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -2765,6 +2765,11 @@ function drupal_render(&$elements) {
// Render all the children that use a theme function.
if (isset($elements['#theme']) && empty($elements['#theme_used'])) {
$elements['#theme_used'] = TRUE;
$previous = array();
foreach (array('#type', '#prefix', '#suffix') as $key) {
$previous[$key] = isset($elements[$key]) ? $elements[$key] : NULL;
}
// If we rendered a single element, then we will skip the renderer.
if (empty($children)) {
$elements['#printed'] = TRUE;
......@@ -2773,7 +2778,12 @@ function drupal_render(&$elements) {
$elements['#markup'] = '';
}
unset($elements['#prefix'], $elements['#suffix']);
$content = theme($elements['#theme'], $elements);
foreach (array('#type', '#prefix', '#suffix') as $key) {
$elements[$key] = isset($previous[$key]) ? $previous[$key] : NULL;
}
}
// Render each of the children using drupal_render and concatenate them.
if (!isset($content) || $content === '') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment