core/modules/block/block.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 3018f38..9c6a013 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -174,8 +174,12 @@ function block_get_blocks_by_region($region) { $build[$key] = entity_view($block, 'block'); } } - // block_list() already returned the blocks in sorted order. - $build['#sorted'] = TRUE; + // If none of the blocks in this region are visible, then don't set anything + // else in the render array, because that would cause the region to show up. + if (!empty($build)) { + // block_list() already returned the blocks in sorted order. + $build['#sorted'] = TRUE; + } } return $build; }