blocks MDL-25074 When adding pretend blocks if the requested region doesn't exist it now uses the default region.

This commit is contained in:
Sam Hemelryk
2010-11-05 03:45:32 +00:00
parent 367a75fae4
commit bf2b43dfe1
+3 -1
View File
@@ -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.');