Make threads recalculate rating on delete/restore. Fixes #10788.
This commit is contained in:
parent
743e615fd8
commit
3d1ed2f83f
2 changed files with 9 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
7.7.18
|
7.7.18
|
||||||
|
- fixed #10788: Thread rating calculate during post delete/restore
|
||||||
- will now respect X-Forwarded-Proto header
|
- will now respect X-Forwarded-Proto header
|
||||||
- no longer need special Apache configuration to handle SSLPROXY header
|
- no longer need special Apache configuration to handle SSLPROXY header
|
||||||
- fixed #10674: CDN URLs are cached across HTTP/HTTPS accesses
|
- fixed #10674: CDN URLs are cached across HTTP/HTTPS accesses
|
||||||
|
|
|
||||||
|
|
@ -1255,14 +1255,16 @@ sub recalculatePostRating {
|
||||||
|
|
||||||
=head2 restore
|
=head2 restore
|
||||||
|
|
||||||
Extend the base class to also make the thread containing this post to recalculate its replies
|
Extend the base class to also make the thread containing this post to recalculate its replies and
|
||||||
|
the thread rating.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub restore {
|
sub restore {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::restore(@_);
|
$self->SUPER::restore(@_);
|
||||||
$self->getThread->sumReplies;
|
$self->getThread->sumReplies;
|
||||||
|
$self->getThread->updateThreadRating;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1338,7 +1340,7 @@ sub setStatusUnarchived {
|
||||||
|
|
||||||
=head2 trash ( )
|
=head2 trash ( )
|
||||||
|
|
||||||
Moves post to the trash and updates reply counter on thread.
|
Moves post to the trash, updates reply counter on thread and recalculates the thread rating.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1346,6 +1348,7 @@ sub trash {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::trash;
|
$self->SUPER::trash;
|
||||||
$self->getThread->sumReplies if ($self->isReply);
|
$self->getThread->sumReplies if ($self->isReply);
|
||||||
|
$self->getThread->updateThreadRating;
|
||||||
if ($self->getThread->get("lastPostId") eq $self->getId) {
|
if ($self->getThread->get("lastPostId") eq $self->getId) {
|
||||||
my $threadLineage = $self->getThread->get("lineage");
|
my $threadLineage = $self->getThread->get("lineage");
|
||||||
my ($id, $date) = $self->session->db->quickArray("select assetId, creationDate from asset where
|
my ($id, $date) = $self->session->db->quickArray("select assetId, creationDate from asset where
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue