]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18927 fixed performance regression
authorskodak <skodak>
Wed, 22 Apr 2009 19:40:21 +0000 (19:40 +0000)
committerskodak <skodak>
Wed, 22 Apr 2009 19:40:21 +0000 (19:40 +0000)
lib/grade/grade_category.php
lib/grade/grade_item.php

index a7fd948255ac027403eeb3d59da4691d57fcf648..4c7bc71fc087d7ae83934b3ed8598f03148fe10d 100644 (file)
@@ -832,14 +832,14 @@ class grade_category extends grade_object {
 
         // Stop recursing upwards if this category aggregates subcats or has no parent
         if (!$first && !$this->aggregatesubcats) {
-            if ($parent_category = $this->get_parent_category()) {
+            if ($parent_category = $this->load_parent_category()) {
                 return $parent_category->get_coefstring(false);
             } else {
                 return null;
             }
         } elseif ($first) {
             if (!$this->aggregatesubcats) {
-                if ($parent_category = $this->get_parent_category()) {
+                if ($parent_category = $this->load_parent_category()) {
                     $overriding_coefstring = $parent_category->get_coefstring(false);
                 }
             }
index 8a4392e3cc51f092d0b8f6b84310eae8a34959c7..a67b112a4460ff66530801df9f9cf3db5e44e5f5 100644 (file)
@@ -1189,7 +1189,7 @@ class grade_item extends grade_object {
 
         } else if ($this->is_category_item()) {
             if ($fulltotal) {
-                $category = $this->get_parent_category();
+                $category = $this->load_parent_category();
                 $a = new stdClass();
                 $a->category = $category->get_name();
                 return get_string('categorytotalfull', 'grades', $a);
@@ -1977,9 +1977,9 @@ class grade_item extends grade_object {
      * grade item.
      */
     public function get_coefstring() {
-        $parent_category = $this->get_parent_category();
+        $parent_category = $this->load_parent_category();
         if ($this->is_category_item()) {
-            $parent_category = $parent_category->get_parent_category();
+            $parent_category = $parent_category->load_parent_category();
         }
 
         if ($parent_category->is_aggregationcoef_used()) {