Force a recount of threads since the archive bug could make them out of date.
This commit is contained in:
parent
6e0983a67b
commit
dc94fe351a
1 changed files with 16 additions and 0 deletions
|
|
@ -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 --------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue