Commit c679b5db authored by catch's avatar catch

Issue #2068217 by thedavidmeister: Fixed array('hook') syntax for suggestions...

Issue #2068217 by thedavidmeister: Fixed array('hook') syntax for suggestions is broken for #theme_wrappers().
parent de9f13c1
......@@ -3916,7 +3916,7 @@ function drupal_render(&$elements) {
// only this theme() call. This allows #theme hooks and #theme_wrappers
// hooks to share variable names without conflict or ambiguity.
$wrapper_elements = $elements;
if (is_array($value)) {
if (is_string($key)) {
$wrapper_hook = $key;
foreach ($value as $attribute => $override) {
$wrapper_elements[$attribute] = $override;
......
......@@ -134,6 +134,15 @@ function testDrupalRenderBasics() {
),
'expected' => '<div class="foo"><div class="bar"></div></div>',
),
// Array syntax theme hook suggestion in #theme_wrappers.
array(
'name' => '#theme_wrappers implements an array style theme hook suggestion',
'value' => array(
'#theme_wrappers' => array(array('container')),
'#attributes' => array('class' => 'foo'),
),
'expected' => '<div class="foo"></div>',
),
// Test handling of #markup as a fallback for #theme hooks.
// Simple #markup with no theme.
......
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