]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed up cancel button on module editing page to avoid error
authormoodler <moodler>
Fri, 8 Aug 2003 16:46:16 +0000 (16:46 +0000)
committermoodler <moodler>
Fri, 8 Aug 2003 16:46:16 +0000 (16:46 +0000)
when returning to course page.

Fix by Scott Elliott.

course/mod.php

index cda0b8c77c7651cbf3cc2a5ce5aca9016b054a33..4753f353f1cd48119f86e4aba459f4650035dbfa 100644 (file)
@@ -7,6 +7,13 @@
 
     require_login();
 
+    if (isset($SESSION->modform)) {   // Variables are stored in the session
+        $mod = $SESSION->modform;
+        unset($SESSION->modform);
+    } else {
+        $mod = (object)$_POST;
+    }
+
     if (isset($cancel)) {  
         if (!empty($SESSION->returnpage)) {
             $return = $SESSION->returnpage;
 
     if (isset($_POST["course"])) {    // add or update form submitted
 
-        if (isset($SESSION->modform)) {   // Variables are stored in the session
-            $mod = $SESSION->modform;
-            unset($SESSION->modform);
-        } else {
-            $mod = (object)$_POST;
-        }
-
         if (!isteacher($mod->course)) {
             error("You can't modify this course!");
         }