MDL-18927 fixed performance regression

This commit is contained in:
skodak 2009-04-22 19:40:21 +00:00
parent 842feb0612
commit 121d8006e4
2 changed files with 5 additions and 5 deletions

View file

@ -832,14 +832,14 @@ class grade_category extends grade_object {
// Stop recursing upwards if this category aggregates subcats or has no parent // Stop recursing upwards if this category aggregates subcats or has no parent
if (!$first && !$this->aggregatesubcats) { if (!$first && !$this->aggregatesubcats) {
if ($parent_category = $this->get_parent_category()) { if ($parent_category = $this->load_parent_category()) {
return $parent_category->get_coefstring(false); return $parent_category->get_coefstring(false);
} else { } else {
return null; return null;
} }
} elseif ($first) { } elseif ($first) {
if (!$this->aggregatesubcats) { if (!$this->aggregatesubcats) {
if ($parent_category = $this->get_parent_category()) { if ($parent_category = $this->load_parent_category()) {
$overriding_coefstring = $parent_category->get_coefstring(false); $overriding_coefstring = $parent_category->get_coefstring(false);
} }
} }

View file

@ -1189,7 +1189,7 @@ class grade_item extends grade_object {
} else if ($this->is_category_item()) { } else if ($this->is_category_item()) {
if ($fulltotal) { if ($fulltotal) {
$category = $this->get_parent_category(); $category = $this->load_parent_category();
$a = new stdClass(); $a = new stdClass();
$a->category = $category->get_name(); $a->category = $category->get_name();
return get_string('categorytotalfull', 'grades', $a); return get_string('categorytotalfull', 'grades', $a);
@ -1977,9 +1977,9 @@ class grade_item extends grade_object {
* grade item. * grade item.
*/ */
public function get_coefstring() { public function get_coefstring() {
$parent_category = $this->get_parent_category(); $parent_category = $this->load_parent_category();
if ($this->is_category_item()) { 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()) { if ($parent_category->is_aggregationcoef_used()) {