mirror of
https://github.com/moodle/moodle.git
synced 2025-04-27 03:14:20 +02:00
fix for error in logic about where to redirect to after a cancel or after activity mod is successfully added or update.
This commit is contained in:
parent
0befbdfd8f
commit
0b82f5b913
@ -47,7 +47,7 @@
|
||||
if (file_exists("../mod/$modname/mod_form.php")) {
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$section = required_param('section', PARAM_INT);
|
||||
$returntomod = optional_param('return', PARAM_BOOL);
|
||||
$returntomod = optional_param('return', 0, PARAM_BOOL);
|
||||
|
||||
redirect("modedit.php?add=$add&course=$id§ion=$section&return=$returntomod");
|
||||
}
|
||||
@ -59,7 +59,7 @@
|
||||
md.id = cm.module")){
|
||||
error('Invalid course module id!');
|
||||
}
|
||||
$returntomod = optional_param('return', PARAM_BOOL);
|
||||
$returntomod = optional_param('return', 0, PARAM_BOOL);
|
||||
if (file_exists("../mod/$modname/mod_form.php")) {
|
||||
redirect("modedit.php?update=$update&return=$returntomod");
|
||||
}
|
||||
|
@ -40,7 +40,7 @@
|
||||
$form->instance = "";
|
||||
$form->coursemodule = "";
|
||||
$form->add=$add;
|
||||
$form->return=0;//must be false if this is an add, go back to course view
|
||||
$form->return=0;//must be false if this is an add, go back to course view on cancel
|
||||
if (!empty($type)) {
|
||||
$form->type = $type;
|
||||
}
|
||||
@ -254,11 +254,7 @@
|
||||
|
||||
rebuild_course_cache($course->id);
|
||||
|
||||
if ($return && isset($cm)){
|
||||
redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id");
|
||||
} else {
|
||||
redirect("view.php?id=$course->id#section-".$cousesection);
|
||||
}
|
||||
redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$fromform->coursemodule");
|
||||
exit;
|
||||
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user