From 8d9a0ae64b567a7f58a83c025d98b7d8e00ed8d5 Mon Sep 17 00:00:00 2001 From: vyshane Date: Thu, 14 Sep 2006 03:18:37 +0000 Subject: [PATCH] Fix for MDL-6517. Patch by David Mudrak. --- mod/forum/post.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index 5026d55734..987c197d60 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -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)) { @@ -113,7 +113,8 @@ 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); @@ -191,7 +192,8 @@ $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)) { -- 2.39.5