Merge branch 'MDL-59629-master' of git://github.com/peterRd/moodle
authorJun Pataleta <jun@moodle.com>
Mon, 17 Dec 2018 07:57:52 +0000 (15:57 +0800)
committerJun Pataleta <jun@moodle.com>
Mon, 17 Dec 2018 07:57:52 +0000 (15:57 +0800)
lib/blocklib.php

index 18172c2..07ba246 100644 (file)
@@ -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);
+        }
     }
 
     /**