From 3b08bbf7afd6a1cc506d140a27c125c906b078cb Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Mon, 22 Jan 2007 20:25:44 +0000 Subject: [PATCH] Fixed a bug where isCurrentPost was not set correctly --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/Post.pm | 2 +- lib/WebGUI/Asset/Post/Thread.pm | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index af4d9beaa..6866f15c0 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -8,6 +8,8 @@ - fix: Extra cruft in the Zip Archive template. - fix: fixed corner case in WebGUI::Operation::Workflow.pm which could cause the edit page to not load and display an error if an activity is undefined or cannot be defined. - fix: testEnvironment.pl do not tests all modules (perlDreamer Consulting, LLC) + - fix: Fixed a bug where the isCurrentPost tmpl_var would always be set to the + first post of the thread in stead of the current post. (Martin Kamerbeek / Oqapi) 7.3.5 diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 9c1c784b6..fe458f789 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -1261,7 +1261,7 @@ sub www_showConfirmation { sub www_view { my $self = shift; $self->incrementViews; - return $self->getThread->www_view; + return $self->getThread->www_view($self); } diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index 5d20f89a6..639be1241 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -1059,6 +1059,7 @@ Renders self->view based upon current style, subject to timeouts. Returns Privil sub www_view { my $self = shift; + my $currentPost = shift; return $self->session->privilege->noAccess() unless $self->canView; my $check = $self->checkView; return $check if (defined $check); @@ -1068,7 +1069,7 @@ sub www_view { my $style = $self->getParent->processStyle("~~~"); my ($head, $foot) = split("~~~",$style); $self->session->output->print($head,1); - $self->session->output->print($self->view); + $self->session->output->print($self->view($currentPost)); $self->session->output->print($foot,1); return "chunked"; }