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
|
|
@ -1,4 +1,5 @@
|
||||||
7.7.18
|
7.7.18
|
||||||
|
- fixed #10758: CS #replies does not get updated after post restore from trash (Bart Jol / Procolix)
|
||||||
- fixed #10781: User Profile Editable/Required gotcha
|
- fixed #10781: User Profile Editable/Required gotcha
|
||||||
- fixed #10786: Matrix navigation: search screen to view screen
|
- fixed #10786: Matrix navigation: search screen to view screen
|
||||||
- fixed #10766: Matrix search: search dropdowns do not match what is displayed when search form opens.
|
- fixed #10766: Matrix search: search dropdowns do not match what is displayed when search form opens.
|
||||||
|
|
|
||||||
|
|
@ -1251,6 +1251,21 @@ sub recalculatePostRating {
|
||||||
$self->update({rating=>$sum});
|
$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)
|
=head2 rethreadUnder ($thread)
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,20 @@ sub purge {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 restore
|
||||||
|
|
||||||
|
Publishes assets from the trash.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub restore {
|
||||||
|
my $self = shift;
|
||||||
|
$self->publish;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 trash ( $options )
|
=head2 trash ( $options )
|
||||||
|
|
@ -479,7 +493,7 @@ sub www_restoreList {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
foreach my $id ($self->session->form->param("assetId")) {
|
foreach my $id ($self->session->form->param("assetId")) {
|
||||||
my $asset = eval { WebGUI::Asset->newPending($self->session,$id); };
|
my $asset = eval { WebGUI::Asset->newPending($self->session,$id); };
|
||||||
$asset->publish if $asset->canEdit;
|
$asset->restore if $asset->canEdit;
|
||||||
}
|
}
|
||||||
if ($self->session->form->process("proceed") ne "") {
|
if ($self->session->form->process("proceed") ne "") {
|
||||||
my $method = "www_".$self->session->form->process("proceed");
|
my $method = "www_".$self->session->form->process("proceed");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue