mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-21781 cohorts may be moved to different course categories/system context
This commit is contained in:
parent
864e2805d0
commit
9e1065a812
2 changed files with 33 additions and 9 deletions
|
@ -99,8 +99,7 @@ if ($cohort->id) {
|
|||
$PAGE->set_title($strheading);
|
||||
$PAGE->navbar->add($strheading);
|
||||
|
||||
$editform = new cohort_edit_form(null, array('editoroptions'=>$editoroptions));
|
||||
$editform->set_data($cohort);
|
||||
$editform = new cohort_edit_form(null, array('editoroptions'=>$editoroptions, 'data'=>$cohort));
|
||||
|
||||
if ($editform->is_cancelled()) {
|
||||
redirect($returnurl);
|
||||
|
@ -114,7 +113,8 @@ if ($editform->is_cancelled()) {
|
|||
cohort_add_cohort($data);
|
||||
}
|
||||
|
||||
redirect($returnurl);
|
||||
// use new context id, it could have been changed
|
||||
redirect(new moodle_url('/cohort/index.php', array('contextid'=>$data->contextid)));
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue