Fix how Thread determines the "current" Post to be a little more logical,
and fix shortcuts to non-Thread Posts (they weren't doing prepareView on the thread).
This commit is contained in:
parent
3ca4bf725a
commit
0903b1011e
3 changed files with 13 additions and 2 deletions
|
|
@ -13,6 +13,7 @@
|
|||
- fix: HttpProxy now handles styles appropriately.
|
||||
- fix: op=viewPurchaseHistory prices are now formatted correctly
|
||||
- fix: A minor bug in the default viewPurchaseHistory template
|
||||
- fix: Thread determination of "current" Post, and shortcuts to non-Thread Posts
|
||||
|
||||
7.2.1
|
||||
- Made a change to version tag commits to deal with unusually long commit
|
||||
|
|
|
|||
|
|
@ -979,10 +979,19 @@ sub update {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub prepareView {
|
||||
my $self = shift;
|
||||
$self->SUPER::prepareView;
|
||||
unless ($self->getThread->getId eq $self->getId) {
|
||||
# Need the unless to avoid infinite recursion.
|
||||
$self->getThread->prepareView;
|
||||
}
|
||||
}
|
||||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
$self->incrementViews;
|
||||
return $self->getThread->view;
|
||||
return $self->getThread->view($self);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -770,6 +770,7 @@ sub unsubscribe {
|
|||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
my $currentPost = shift || $self;
|
||||
$self->markRead;
|
||||
$self->incrementViews unless ($self->session->form->process("func") eq 'rate');
|
||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("layout")) {
|
||||
|
|
@ -852,7 +853,7 @@ sub view {
|
|||
my $reply = WebGUI::Asset::Post->new($self->session, $dataSet->{assetId}, $dataSet->{className}, $dataSet->{revisionDate});
|
||||
$reply->{_thread} = $self; # caching thread for better performance
|
||||
my %replyVars = %{$reply->getTemplateVars};
|
||||
$replyVars{isCurrent} = ($reply->get("url") eq $currentPageUrl);
|
||||
$replyVars{isCurrent} = ($reply->getId eq $currentPost->getId);
|
||||
$replyVars{isThreadRoot} = $self->getId eq $reply->getId;
|
||||
$replyVars{depth} = $reply->getLineageLength - $self->getLineageLength;
|
||||
$replyVars{depthX10} = $replyVars{depth}*10;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue