mod_attendance: Fix #92 Set page URL
authorBarry Oosthuizen <barry.oosthuizen@nottingham.ac.uk>
Wed, 27 May 2015 14:58:15 +0000 (15:58 +0100)
committerBarry Oosthuizen <barry.oosthuizen@nottingham.ac.uk>
Wed, 27 May 2015 15:08:19 +0000 (16:08 +0100)
attendance.php

index 539354c..f08b89d 100644 (file)
@@ -51,6 +51,8 @@ require_sesskey();
 $mform = new mod_attendance_student_attendance_form(null,
         array('course' => $course, 'cm' => $cm, 'modcontext' => $PAGE->context, 'session' => $attforsession, 'attendance' => $att));
 
+$PAGE->set_url($att->url_sessions());
+
 if ($mform->is_cancelled()) {
     // The user cancelled the form, so redirect them to the view page.
     $url = new moodle_url('/mod/attendance/view.php', array('id' => $cm->id));
@@ -72,7 +74,6 @@ if ($mform->is_cancelled()) {
     $mform->set_data($fromform);
 }
 
-$PAGE->set_url($att->url_sessions());
 $PAGE->set_title($course->shortname. ": ".$att->name);
 $PAGE->set_heading($course->fullname);
 $PAGE->set_cacheable(true);