From: skodak Date: Wed, 22 Apr 2009 19:40:21 +0000 (+0000) Subject: MDL-18927 fixed performance regression X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=121d8006e40c4e81601066d787226657fecb158c;p=moodle.git MDL-18927 fixed performance regression --- diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index a7fd948255..4c7bc71fc0 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -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); } } diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index 8a4392e3cc..a67b112a44 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -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()) {