From dc41a0c9aee1a39b24d033e330011859188cda08 Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Fri, 2 Apr 2004 21:32:00 +0000 Subject: [PATCH] Bugfix [ 884375 ] Fix for multiple forum posts caused by browser refresh: applied to www_viewForum to handle postings that start a new thread. --- docs/changelog/6.x.x.txt | 2 ++ lib/WebGUI/Forum/UI.pm | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 210b22122..f37d68094 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,6 +1,8 @@ 6.0.2 - Fixed a bug where visitor contributed items in the USS were editable by all visitors. + - Bugfix [ 884375 ] Fix for multiple forum posts applied also to + www_viewForum to handle postings that start a new thread. 6.0.1 diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 7d1757e31..bee2402d0 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -2276,6 +2276,12 @@ sub www_viewForum { my ($caller, $forumId) = @_; WebGUI::Session::setScratch("forumSortBy",$session{form}{sortBy}); $forumId = $session{form}{forumId} unless ($forumId); + # if POST, cause redirect, so new post is displayed using GET instead of POST + if ($session{env}{REQUEST_METHOD} =~ /POST/i) { + my $url= formatForumURL($caller->{callback}, $forumId); + $session{header}{redirect} = WebGUI::Session::httpRedirect($url); + return ""; + } my $forum = WebGUI::Forum->new($forumId); return WebGUI::Privilege::insufficient() unless ($forum->canView); my $var = getForumTemplateVars($caller, $forum);