moving the class instantiation a bit earlier so that we can safely modify it
authorskodak <skodak>
Thu, 4 Oct 2007 08:48:04 +0000 (08:48 +0000)
committerskodak <skodak>
Thu, 4 Oct 2007 08:48:04 +0000 (08:48 +0000)
grade/edit/tree/outcomeitem.php

index aa90c21522674127be2c6efe2d415912bf19c0af..0e55cc8d9e29ce6c9fb95db7646667c24570fdb6 100644 (file)
@@ -28,6 +28,8 @@ if ($mform->is_cancelled() || empty($CFG->enableoutcomes)) {
 }
 
 if ($item = get_record('grade_items', 'id', $id, 'courseid', $course->id)) {
+    $item = new grade_item($item, false);
+
     // redirect if outcomeid present
     if (empty($item->outcomeid)) {
         $url = $CFG->wwwroot.'/grade/edit/tree/item.php?id='.$id.'&amp;courseid='.$courseid;
@@ -40,7 +42,6 @@ if ($item = get_record('grade_items', 'id', $id, 'courseid', $course->id)) {
     } else {
         $item->cmid = 0;
     }
-    $item = new grade_item($item);
 
 } else {
     $item = new grade_item(array('courseid'=>$courseid, 'itemtype'=>'manual'));