diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 4c0e580..f4d5c5d 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1032,6 +1032,13 @@ function theme($hook, $variables = array()) { } } else { + foreach ($element as $key => $value) { + // Prevent recursion loops by removing '#theme' and '#theme_wrappers' + // keys. + if ($key == '#theme' || $key == '#theme_wrappers') { + unset($element[$key]); + } + } $variables[$info['render element']] = $element; } }