From 93f583d06977d9aaf05145aac0ee608e9d34fe81 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 27 Aug 2012 18:26:05 -0700 Subject: [PATCH] getLastPost in Thread.pm should not cast its data, but allow the asset to determine its own type. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Post/Thread.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 46092060f..5f128ac07 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,6 +1,7 @@ 7.10.27 - fixed #12379: userImport documentation error - fixed #12382: WebGUI::Crud does not work with all form types + - fixed: Threads with no posts return the wrong lastReply data. 7.10.26 - fixed: Template diagnostics when called without a session asset. diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index 7878b5e72..ecf14bd7f 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -450,7 +450,7 @@ sub getLastPost { my $lastPostId = $self->get("lastPostId"); my $lastPost; if ($lastPostId) { - $lastPost = WebGUI::Asset::Post->new($self->session, $lastPostId); + $lastPost = WebGUI::Asset->newByDynamicClass($self->session, $lastPostId); } return $lastPost if (defined $lastPost); return $self;