diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-08-16 07:33:05 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-08-16 07:33:05 +0000 |
commit | 72d13bc3f847c3e58e167148c44dc2a581e4970e (patch) | |
tree | 55f7431e8ea724248521d8f8a83060494e3fb15f /includes/common.inc | |
parent | c639b5135f669e9e26b9f0982cacda44e788bd1c (diff) | |
download | brdo-72d13bc3f847c3e58e167148c44dc2a581e4970e.tar.gz brdo-72d13bc3f847c3e58e167148c44dc2a581e4970e.tar.bz2 |
- Patch #295506 by swentel: node preview is rendered twice.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index aebb8a199..dbec0f933 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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 === '') { |