From 2dc8a3e72c8a33b1f488eb9edc4ba0367325d34e Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 24 Jan 2008 07:28:27 +0000 Subject: [PATCH] fix rating archived posts --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Post/Thread.pm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index fede7d2f5..cb9da8ed5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -28,6 +28,7 @@ arbitrarily. - fix: Event Related Links are now proper collateral in their own table instead of a silly HTML area + - fix: rating archived posts causes error 7.4.21 - fix: Mails sent from WebGUI now wrap at 78 characters, as the SMTP diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index 07e903fa4..3fe020199 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -818,8 +818,9 @@ sub updateThreadRating { my $calcRating = 0; my $postIds = $self->getLineage(["descendants","self"], { - includeOnlyClasses => ["WebGUI::Asset::Post","WebGUI::Asset::Post::Thread"], - }); + includeOnlyClasses => ["WebGUI::Asset::Post","WebGUI::Asset::Post::Thread"], + includeArchived => 1, + }); $calcRating += $session->db->quickScalar( "SELECT SUM(rating) FROM Post_rating WHERE assetId IN (".$session->db->quoteAndJoin($postIds).")"