From bb13181338be1bea7bca9acbd46d8e80eeadb417 Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 13 Dec 2018 10:14:43 +0800 Subject: [PATCH] MDL-59629 mod_block: Set the default region in add_region Check and update default region in add_region if none set. --- lib/blocklib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/blocklib.php b/lib/blocklib.php index c8fa2455a08..db4d981aa3b 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -519,6 +519,11 @@ class block_manager { } } $this->regions[$region] = 1; + + // Checking the actual property instead of calling get_default_region as it ends up in a recursive call. + if (empty($this->defaultregion)) { + $this->set_default_region($region); + } } /**