]> git.mjollnir.org Git - moodle.git/commitdiff
Check for errors before doing other processing. (Compare this with the add case.)
authortjhunt <tjhunt>
Wed, 31 May 2006 10:34:05 +0000 (10:34 +0000)
committertjhunt <tjhunt>
Wed, 31 May 2006 10:34:05 +0000 (10:34 +0000)
course/mod.php

index 21cde8078efd797844922649e330ca5a01cfd8df..935b32678699fd273d964b0347f7b874b60878de 100644 (file)
@@ -98,6 +98,9 @@
                     }
                     error("Could not update the $mod->modulename", "view.php?id=$course->id");
                 }
+                if (is_string($return)) {
+                    error($return, "view.php?id=$course->id");
+                }
 
                 if (isset($mod->visible)) {
                     set_coursemodule_visible($mod->coursemodule, $mod->visible);
                     set_coursemodule_groupmode($mod->coursemodule, $mod->groupmode);
                 }
 
-                if (is_string($return)) {
-                    error($return, "view.php?id=$course->id");
-                }
-
                 if (isset($mod->redirect)) {
                     $SESSION->returnpage = $mod->redirecturl;
                 } else {