Merge branch 'MDL-69296-m39' of https://github.com/NeillM/moodle into MOODLE_39_STABLE

This commit is contained in:
Andrew Nicols
2020-08-12 10:29:58 +08:00
+6 -1
View File
@@ -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)));
}