Skip to content
Permalink
Browse files

fix for error in logic about where to redirect to after a cancel or a…

…fter activity mod is successfully added or update.
  • Loading branch information
jamiesensei
jamiesensei committed Dec 5, 2006
1 parent 0befbdf commit 0b82f5b9133d00d85ef5cb4da0175690166c4f27
Showing with 4 additions and 8 deletions.
  1. +2 −2 course/mod.php
  2. +2 −6 course/modedit.php
@@ -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&section=$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{

0 comments on commit 0b82f5b

Please sign in to comment.
You can’t perform that action at this time.