]> git.mjollnir.org Git - moodle.git/commitdiff
blocklib: MDL-19010 move the check for whether the right database tables exist to...
authortjhunt <tjhunt>
Thu, 7 May 2009 02:56:48 +0000 (02:56 +0000)
committertjhunt <tjhunt>
Thu, 7 May 2009 02:56:48 +0000 (02:56 +0000)
lib/blocklib.php
lib/pagelib.php

index 5678b668745b568ccc56c31d4d49846ff2f59404..a873e4ac099024d5e2ec54f9675ea8ced590d45c 100644 (file)
@@ -247,12 +247,18 @@ class block_manager implements ArrayAccess {
      * This method actually loads the blocks for our page from the database.
      */
     public function load_blocks($includeinvisible = NULL) {
-        global $DB;
+        global $DB, $CFG;
         if (!is_null($this->birecordsbyregion)) {
             // Already done.
             return;
         }
 
+        if ($CFG->version < 2009050619) {
+            // Upgrade/install not complete. Don't try too show any blocks.
+            $this->birecordsbyregion = array();
+            return;
+        }
+
         if (is_null($includeinvisible)) {
             $includeinvisible = $this->page->user_is_editing();
         }
index 87d80b8a9f10c54947f0796c45d455f4a63cd12a..3c9070d19ef1bc33b4592f4ee1f72f98ddcd1348 100644 (file)
@@ -580,10 +580,7 @@ class moodle_page {
         }
 
         $this->initialise_standard_body_classes();
-
-        if ($CFG->version >= 2009050619) {
-            $this->blocks->load_blocks();
-        }
+        $this->blocks->load_blocks();
     }
 
     /**