diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index d5f11495b..629b927c1 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -80,6 +80,7 @@ providing the DBIx::Tree::NestedSet module. - Dropped page tree caching and stepped onto Navigation caching. This helps scalability a lot. Thanks to Martin Kamerbeek / Procolix + - bugfix [ 977201 ] ws client bug diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 2a74e5471..8c87ef4fd 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -351,7 +351,7 @@ The unique id for the forum. =cut sub formatForumURL { - return WebGUI::URL::append($_[0],"forumOp=viewForum&forumId=".$_[1]); + return WebGUI::URL::append($_[0],"forumOp=viewForum&forumId=".$_[1]); } @@ -782,7 +782,7 @@ The unique id for the post. =cut sub formatThreadURL { - return WebGUI::URL::append($_[0],"forumOp=viewThread&forumPostId=".$_[1]."#".$_[1]); + return WebGUI::URL::append($_[0],"forumOp=viewThread&forumPostId=".$_[1]."#".$_[1]); } #------------------------------------------------------------------- @@ -1936,7 +1936,9 @@ sub www_postSave { $postData{parentId} = $session{form}{parentId}; my $post = WebGUI::Forum::Post->create(\%postData); setPostStatus($caller,$post); - return www_viewThread($caller,$post->get("forumPostId")); + WebGUI::HTTP::setRedirect(formatThreadURL($caller->{callback}, $post->get("forumPostId"))); + return "Redirecting..."; + #return www_viewThread($caller,$post->get("forumPostId")); } if ($session{form}{forumPostId} > 0) { # edit my $post = WebGUI::Forum::Post->new($session{form}{forumPostId}); @@ -1947,7 +1949,9 @@ sub www_postSave { ." $session{user}{username}) --- \n"; } $post->set(\%postData); - return www_viewThread($caller,$post->get("forumPostId")); + WebGUI::HTTP::setRedirect(formatThreadURL($caller->{callback}, $post->get("forumPostId"))); + return "Redirecting..."; + #return www_viewThread($caller,$post->get("forumPostId")); } if ($forumId) { # new post %postData = (%postData, %postDataNew); @@ -1961,7 +1965,8 @@ sub www_postSave { $thread->subscribe($session{user}{userId}) if ($session{form}{subscribe}); setPostStatus($caller,$thread->getPost($thread->get("rootPostId"))); WebGUI::HTTP::setRedirect(formatForumURL($caller->{callback}, $forumId)); - return ""; + return "Redirecting..."; + #return www_viewForum($caller,$forumId); } } @@ -2289,8 +2294,14 @@ Specify a forumId and call this method directly, rather than over the web. sub www_viewForum { my ($caller, $forumId) = @_; - WebGUI::Session::setScratch("forumSortBy",$session{form}{sortBy}); + # 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); +# WebGUI::HTTP::setRedirect($url); + # return ""; + # } $forumId = $session{form}{forumId} unless ($forumId); + WebGUI::Session::setScratch("forumSortBy",$session{form}{sortBy}); my $forum = WebGUI::Forum->new($forumId); return WebGUI::Privilege::insufficient() unless ($forum->canView); my $var = getForumTemplateVars($caller, $forum); @@ -2321,12 +2332,6 @@ sub www_viewThread { my ($caller, $postId) = @_; WebGUI::Session::setScratch("forumThreadLayout",$session{form}{layout}); $postId = $session{form}{forumPostId} unless ($postId); - # If POST, cause redirect, so new post is displayed using GET instead of POST - if ($session{env}{REQUEST_METHOD} =~ /POST/i) { - my $url= formatThreadURL($caller-> {callback}, $postId); - WebGUI::HTTP::setRedirect($url); - return ""; - } my $post = WebGUI::Forum::Post->new($postId); return WebGUI::Privilege::insufficient() unless ($post->getThread->getForum->canView); my $var = getThreadTemplateVars($caller, $post); diff --git a/lib/WebGUI/URL.pm b/lib/WebGUI/URL.pm index 1989fd2f4..a326aa12e 100644 --- a/lib/WebGUI/URL.pm +++ b/lib/WebGUI/URL.pm @@ -95,7 +95,7 @@ sub append { my ($url); $url = $_[0]; if ($url =~ /\?/) { - $url .= '&'.$_[1]; + $url .= '&'.$_[1]; } else { $url .= '?'.$_[1]; } diff --git a/lib/WebGUI/Wobject/MessageBoard.pm b/lib/WebGUI/Wobject/MessageBoard.pm index 914485820..a8c4a78e2 100644 --- a/lib/WebGUI/Wobject/MessageBoard.pm +++ b/lib/WebGUI/Wobject/MessageBoard.pm @@ -236,7 +236,7 @@ sub www_view { my $caller; my $sth = WebGUI::SQL->read("select * from MessageBoard_forums where wobjectId=".$_[0]->get("wobjectId")." order by sequenceNumber"); while (my $forumMeta = $sth->hashRef) { - my $callback = WebGUI::URL::page("func=view&wid=".$_[0]->get("wobjectId")."&forumId=".$forumMeta->{forumId}); + my $callback = WebGUI::URL::page("func=view&wid=".$_[0]->get("wobjectId")."&forumId=".$forumMeta->{forumId}); if ($session{form}{forumOp}) { if ($session{form}{forumId} == $forumMeta->{forumId}) { $caller = {