ソースを参照

Changed redirection after submission either completed or cancelled to a moodle url built from full path to view.php
instead of relative path from mod base folder.

Bernardo 2 年 前
コミット
ffd0b9a5cf
1 ファイル変更4 行追加2 行削除
  1. 4 2
      forms/submission/submission.php

+ 4 - 2
forms/submission/submission.php

@@ -80,7 +80,8 @@ $mform = new mod_gradeimporter_submission_form(null, array('submission' => $entr
 
 if ($mform->is_cancelled()) {
   // Handle form cancel operation, if cancel button is present on form
-  redirect("view.php?id=$cm->id&edit=1");
+  $viewurl = new moodle_url('/mod/gradeimporter/view.php', ['id' => $cm->id, 'edit' => 1]);
+  redirect($viewurl);
 } else if ($formdata = $mform->get_data()) {
 
   validate_formdata($formdata);
@@ -94,7 +95,8 @@ if ($mform->is_cancelled()) {
 
   store_files($context, $cm, $entry);
   // When complete redirect to view.php
-  redirect("view.php?id=$cm->id&edit=1");
+  $viewurl = new moodle_url('/mod/gradeimporter/view.php', ['id' => $cm->id, 'edit' => 1]);
+  redirect($viewurl);
 
 } else {
   // This branch is executed if the form is submitted but the data doesn't validate and the form should be redisplayed