From 3998cc5c589a9094e9309d41bde782bbd648698c Mon Sep 17 00:00:00 2001
From: nicolasconnault <nicolasconnault>
Date: Thu, 12 Feb 2009 08:02:53 +0000
Subject: [PATCH] MDL-16913

---
 grade/edit/tree/lib.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php
index cff1baac4b..b34f91affc 100755
--- a/grade/edit/tree/lib.php
+++ b/grade/edit/tree/lib.php
@@ -621,13 +621,14 @@ class grade_edit_tree_column_range extends grade_edit_tree_column {
     }
 
     public function get_item_cell($item, $params) {
+        global $DB;
 
         // If the parent aggregation is Sum of Grades, this cannot be changed
         $parent_cat = $item->get_parent_category();
         if ($parent_cat->aggregation == GRADE_AGGREGATE_SUM) {
             $grademax = format_float($item->grademax, $item->get_decimals());
         } elseif ($item->gradetype == GRADE_TYPE_SCALE) {
-            $scale = get_record('scale', 'id', $item->scaleid);
+            $scale = $DB->get_record('scale', array('id' => $item->scaleid));
             $scale_items = explode(',', $scale->scale);
             $grademax = end($scale_items) . ' (' . count($scale_items) . ')';
         } elseif ($item->is_external_item()) {
-- 
2.39.5