From dc94fe351a82695167e376c1f1734220abc1b6eb Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 11 Jan 2010 14:00:04 -0800 Subject: [PATCH] Force a recount of threads since the archive bug could make them out of date. --- docs/upgrades/upgrade_7.8.9-7.8.10.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/upgrades/upgrade_7.8.9-7.8.10.pl b/docs/upgrades/upgrade_7.8.9-7.8.10.pl index 78e9d80ab..29269a11a 100644 --- a/docs/upgrades/upgrade_7.8.9-7.8.10.pl +++ b/docs/upgrades/upgrade_7.8.9-7.8.10.pl @@ -22,6 +22,7 @@ use Getopt::Long; use WebGUI::Session; use WebGUI::Storage; use WebGUI::Asset; +use WebGUI::Asset::Wobject::Collaboration; my $toVersion = '7.8.10'; @@ -31,6 +32,7 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +recountCsThreads($session); finish($session); # this line required @@ -44,6 +46,20 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +# Describe what our function does +sub recountCsThreads { + my $session = shift; + print "\tRecount all threads in each CS on the site. This may take a long time... " unless $quiet; + # and here's our code + my $iterator = WebGUI::Asset::Wobject::Collaboration->getIsa($session); + while ( my $cs = $iterator->() ) { + print "\n\t\tRecounting ".$cs->getTitle." ..." unless $quiet; + $cs->incrementReplies($cs->get('lastPostDate'), $cs->get('lastPostId')); + } + print "DONE!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE --------------------------------