From bf2b43dfe1a5edc91f32516c975ae73df1c1ffd6 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Fri, 5 Nov 2010 03:45:32 +0000 Subject: [PATCH] blocks MDL-25074 When adding pretend blocks if the requested region doesn't exist it now uses the default region. --- lib/blocklib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/blocklib.php b/lib/blocklib.php index dd8a7bfebf0..be0831f008c 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -411,7 +411,9 @@ class block_manager { */ public function add_pretend_block($bc, $region) { $this->page->initialise_theme_and_output(); - $this->check_region_is_known($region); + if (!$this->is_known_region($region)) { + $region = $this->get_default_region(); + } if (array_key_exists($region, $this->visibleblockcontent)) { throw new coding_exception('block_manager has already prepared the blocks in region ' . $region . 'for output. It is too late to add a pretend block.');