mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-18927 fixed performance regression
This commit is contained in:
parent
842feb0612
commit
121d8006e4
2 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue