summaryrefslogtreecommitdiff
path: root/modules/block/block.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/block/block.module')
-rw-r--r--modules/block/block.module7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/block/block.module b/modules/block/block.module
index aeb4bddc1..83146e9ab 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -241,7 +241,7 @@ function block_page_alter($page) {
// Load all region content assigned via blocks.
foreach (array_keys($regions) as $region) {
// Prevent left and right regions from rendering blocks when 'show_blocks' == FALSE.
- if ($page['#show_blocks'] || ($region != 'left' && $region != 'right')) {
+ if (!empty($page['#show_blocks']) || ($region != 'left' && $region != 'right')) {
// Assign blocks to region.
if ($blocks = block_get_blocks_by_region($region)) {
$page[$region]['blocks'] = $blocks;
@@ -760,6 +760,11 @@ function template_preprocess_block(&$variables) {
$variables['block_zebra'] = ($block_counter[$variables['block']->region] % 2) ? 'odd' : 'even';
$variables['block_id'] = $block_counter[$variables['block']->region]++;
+ if (is_array($variables['block']->content)) {
+ // Render the block contents if it is not already rendered.
+ $variables['block']->content = drupal_render($variables['block']->content);
+ }
+
$variables['template_files'][] = 'block-' . $variables['block']->region;
$variables['template_files'][] = 'block-' . $variables['block']->module;
$variables['template_files'][] = 'block-' . $variables['block']->module . '-' . $variables['block']->delta;