From 6f0078e5a0a92070969ce65b65011a10c15bea3b Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 4 Oct 2007 08:48:04 +0000 Subject: [PATCH] moving the class instantiation a bit earlier so that we can safely modify it --- grade/edit/tree/outcomeitem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grade/edit/tree/outcomeitem.php b/grade/edit/tree/outcomeitem.php index aa90c21522..0e55cc8d9e 100644 --- a/grade/edit/tree/outcomeitem.php +++ b/grade/edit/tree/outcomeitem.php @@ -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.'&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')); -- 2.39.5