blocks-navigation MDL-25596 Fixed notice when block config doesn't already exist
authorSam Hemelryk <sam@moodle.com>
Wed, 12 Jan 2011 01:52:30 +0000 (09:52 +0800)
committerSam Hemelryk <sam@moodle.com>
Wed, 12 Jan 2011 01:53:08 +0000 (09:53 +0800)
blocks/navigation/block_navigation.php

index c51efa8..71ad007 100644 (file)
@@ -107,12 +107,16 @@ class block_navigation extends block_base {
         if (!empty($CFG->navcourselimit)) {
             $limit = $CFG->navcourselimit;
         }
         if (!empty($CFG->navcourselimit)) {
             $limit = $CFG->navcourselimit;
         }
+        $expansionlimit = 0;
+        if (!empty($this->config->expansionlimit)) {
+            $expansionlimit = $this->config->expansionlimit;
+        }
         $arguments = array(
             'id'             => $this->instance->id,
             'instance'       => $this->instance->id,
             'candock'        => $this->instance_can_be_docked(),
             'courselimit'    => $limit,
         $arguments = array(
             'id'             => $this->instance->id,
             'instance'       => $this->instance->id,
             'candock'        => $this->instance_can_be_docked(),
             'courselimit'    => $limit,
-            'expansionlimit' => $this->config->expansionlimit
+            'expansionlimit' => $expansionlimit
         );
         $this->page->requires->yui_module(array('core_dock', 'moodle-block_navigation-navigation'), 'M.block_navigation.init_add_tree', array($arguments));
     }
         );
         $this->page->requires->yui_module(array('core_dock', 'moodle-block_navigation-navigation'), 'M.block_navigation.init_add_tree', array($arguments));
     }