From: tjhunt Date: Wed, 31 May 2006 10:34:05 +0000 (+0000) Subject: Check for errors before doing other processing. (Compare this with the add case.) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1dd99728898af44267d1f56518be8dcf38956852;p=moodle.git Check for errors before doing other processing. (Compare this with the add case.) --- diff --git a/course/mod.php b/course/mod.php index 21cde8078e..935b326786 100644 --- a/course/mod.php +++ b/course/mod.php @@ -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); @@ -107,10 +110,6 @@ 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 {