Make Threads recalculate the number of replies when restoring a Post from the Trash.
Fixes bug #10758.
This commit is contained in:
parent
0762ce1730
commit
0511af269d
3 changed files with 31 additions and 1 deletions
|
|
@ -1251,6 +1251,21 @@ sub recalculatePostRating {
|
|||
$self->update({rating=>$sum});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 restore
|
||||
|
||||
Extend the base class to also make the thread containing this post to recalculate its replies
|
||||
|
||||
=cut
|
||||
|
||||
sub restore {
|
||||
my $self = shift;
|
||||
$self->SUPER::restore(@_);
|
||||
$self->getThread->sumReplies;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 rethreadUnder ($thread)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue