diff --git a/modules/block/block.module b/modules/block/block.module index 175bd81d1152..ab3dc2ebe1e4 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -684,8 +684,23 @@ function block_list($region) { else { $page_match = TRUE; } + $block->enabled = $enabled; + $block->page_match = $page_match; + $blocks[$block->region]["{$block->module}_{$block->delta}"] = $block; + } + } - if ($enabled && $page_match) { + // Create an empty array if there were no entries + if (!isset($blocks[$region])) { + $blocks[$region] = array(); + } + + foreach ($blocks[$region] as $key => $block) { + // Render the block content if it has not been created already. + if (!isset($block->content)) { + // Erase the block from the static array - we'll put it back if it has content. + unset($blocks[$region][$key]); + if ($block->enabled && $block->page_match) { // Check the current throttle status and see if block should be displayed // based on server load. if (!($block->throttle && (module_invoke('throttle', 'status') > 0))) { @@ -707,9 +722,5 @@ function block_list($region) { } } } - // Create an empty array if there were no entries - if (!isset($blocks[$region])) { - $blocks[$region] = array(); - } return $blocks[$region]; }