diff --git a/course/modedit.php b/course/modedit.php index 0388708c9a0..4fa052452dc 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -143,7 +143,12 @@ $mform->set_data($data); if ($mform->is_cancelled()) { if ($return && !empty($cm->id)) { - redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id"); + $urlparams = [ + 'id' => $cm->id, // We always need the activity id. + 'forceview' => 1, // Stop file downloads in resources. + ]; + $activityurl = new moodle_url("/mod/$module->name/view.php", $urlparams); + redirect($activityurl); } else { redirect(course_get_url($course, $cw->section, array('sr' => $sectionreturn))); }