]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for MDL-6517. Patch by David Mudrak.
authorvyshane <vyshane>
Thu, 14 Sep 2006 03:18:37 +0000 (03:18 +0000)
committervyshane <vyshane>
Thu, 14 Sep 2006 03:18:37 +0000 (03:18 +0000)
mod/forum/post.php

index 5026d5573413d6b77c4c72167489213adddff336..987c197d60a83a1d2c41f9ab5b6697e257ca5d26 100644 (file)
@@ -13,7 +13,7 @@
     $name = optional_param('name','',PARAM_CLEAN);
     $confirm = optional_param('confirm',0,PARAM_INT);
     
-    
+
     if (isguest()) {
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
                 error("You can not update this post");
             }
 
-            if (get_field('forum', 'type', 'id', $forum) == 'news' && !$post->parent) {
+            if (get_field('forum', 'type', 'id', $forum->id) == 'news' && !$post->parent) {
+                $updatediscussion = new object;
                 $updatediscussion->id = $post->discussion;
                 if (empty($post->timestartdisabled)) {
                     $updatediscussion->timestart = make_timestamp($post->timestartyear, $post->timestartmonth, $post->timestartday);
             $discussion->name  = $post->subject;
             $discussion->intro = $post->message;
             $newstopic = false;
-            if (get_field('forum', 'type', 'id', $forum) == 'news' && !$post->parent) {
+
+            if (get_field('forum', 'type', 'id', $forum->id) == 'news' && !$post->parent) {
                 $newstopic = true;
             }
             if ($newstopic && empty($post->timestartdisabled)) {