### Eclipse Workspace Patch 1.0
#P 18stable
Index: mod/forum/view.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/view.php,v
retrieving revision 1.94.2.5
diff -u -r1.94.2.5 view.php
--- mod/forum/view.php	14 Jan 2009 04:53:45 -0000	1.94.2.5
+++ mod/forum/view.php	4 Apr 2009 19:53:34 -0000
@@ -4,7 +4,6 @@
     require_once('lib.php');
     require_once("$CFG->libdir/rsslib.php");
 
-
     $id          = optional_param('id', 0, PARAM_INT);       // Course Module ID
     $f           = optional_param('f', 0, PARAM_INT);        // Forum ID
     $mode        = optional_param('mode', 0, PARAM_INT);     // Display mode (for single forum)
@@ -13,8 +12,6 @@
     $page        = optional_param('page', 0, PARAM_INT);     // which page to show
     $search      = optional_param('search', '');             // search string
 
-
-
     if ($id) {
 
         if (! $cm = get_coursemodule_from_id('forum', $id)) {
@@ -44,21 +41,21 @@
             error("Forum is misconfigured - don't know what course it's from");
         }
 
-        if ($cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
-            $buttontext = update_module_button($cm->id, $course->id, $strforum);
-        } else {
+        if (!$cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
             $cm->id = 0;
             $cm->visible = 1;
             $cm->course = $course->id;
             $buttontext = "";
-        }
-
-        // move require_course_login here to use forced language for course
+        } 
+         // move require_course_login here to use forced language for course
         // fix for MDL-6926
         require_course_login($course, true, $cm);
-
         $strforums = get_string("modulenameplural", "forum");
         $strforum = get_string("modulename", "forum");
+        
+        if (!$cm->id == 0) {
+            $buttontext = update_module_button($cm->id, $course->id, $strforum);
+        } 
 
     } else {
         error('Must specify a course module or a forum ID');
