mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
moving the class instantiation a bit earlier so that we can safely modify it
This commit is contained in:
parent
3e0e2436de
commit
6f0078e5a0
@ -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'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user