Username Password
Bookmark and Share
View All Tickets
CS #replies does not get updated after post restore from trash  (#10758)

When you delete a post and restore it from the trash, the number of replies of the Thread does not get updated.

Found it in 7.7.16 at wre 0.93 on debian, may need backporting to 7.6

Solution Summary
Added code to make Threads recalculate their number of replies after the Post has been restored.
8/12/2009 11:24 am
made a patch:
line 478-479 in becomes:
               $asset->publish if $asset->canEdit;
               if ($asset->get('className') eq "WebGUI::Asset::Post") {

tested it on 7.7.16 and it works, if it's crappy for some reason, please notify, I can only learn
8/13/2009 2:31 am
ok I heard from Colin that this was not a bad fix, but not the desired place, since it was to specific pointing to 1 asset in a general asset script.

I was wondering whether it might be an idea to instad include a $asset->doOnRecovery function in the same script, even same place which refers to the Asset code. That way there is a general script with the implementation in the asset itself. This will not be ncessary for every asset, so a check whether the method exist will also be necessary.

Second plan: the recovery method of AssetTrash sets the state to isRecovered and a workflow is triggered to check for this state and do stuff for the asset that needs to be done on recovery
8/17/2009 5:16 pm
ok , solution exists of three parts:
1 an extra sub restore that does the publishing for assets in
2 removed that from www_restoreList) in
3 extra restore sub in that refers to the sub mentioned in 1 and after recounts for the thread

1 add code in
=head2 restore

Publishes assets from the trash


sub restore {
       my $self = shift;
       $self->publish if $self->canEdit;


2 replace
       $asset->publish if $asset->canEdit;

3 add code in Asset/
=head2 restore

Takes actions when asset is restored from trash, with Post, it recounts the total replies to the thread


sub restore {
       my $self = shift;

This is also an API change  
8/17/2009 5:27 pm
Fixed in 7.7.18 by Bart Jol.
Resolved by perlDreamer
8/18/2009 7:22 am
related to this, should thread ratings also be recalculated on deleting and restoring?
Please notify me via a private message or irc , then I can report a bug, or not.
Ticket Status Closed  
Submitted Bybartjol 
Date Submitted2009-08-12 
Assigned To unassigned  
Date Assigned2019-08-25 
Assigned By 
Severity Minor (annoying, but not harmful)  
What's the bug in? WebGUI Beta  
WebGUI / WRE Version  
Ticket History
12:22 PM
Closed bartjol
10:27 PM
Resolved perlDreamer
3:37 PM
Ticket created bartjol
© 2019 Plain Black Corporation | All Rights Reserved