From 29892d8739954010f640c988f6048bdc8c19ba09 Mon Sep 17 00:00:00 2001 From: Mary Evans Date: Sun, 8 Sep 2013 17:40:30 +0100 Subject: [PATCH] MDL-41595 mod_book: Book mod does not add TOC to default region --- mod/book/locallib.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/book/locallib.php b/mod/book/locallib.php index bc52dc7a204..0bc90610557 100644 --- a/mod/book/locallib.php +++ b/mod/book/locallib.php @@ -151,7 +151,7 @@ function book_get_chapter_title($chid, $chapters, $book, $context) { } /** - * Add the book TOC sticky block to the 1st region available + * Add the book TOC sticky block to the default region * * @param array $chapters * @param stdClass $chapter @@ -169,9 +169,8 @@ function book_add_fake_block($chapters, $chapter, $book, $cm, $edit) { $bc->attributes['class'] = 'block block_book_toc'; $bc->content = $toc; - $regions = $PAGE->blocks->get_regions(); - $firstregion = reset($regions); - $PAGE->blocks->add_fake_block($bc, $firstregion); + $defaultregion = $PAGE->blocks->get_default_region(); + $PAGE->blocks->add_fake_block($bc, $defaultregion); } /**