diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f265b1297..5f03debcb 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,6 +14,7 @@ - added FilePump, a way to reduce Yslow scores by minimizing JS, CSS and the number of files transferred. - fixed #10394: CC Purchases Fail When Variants Contain Trailing Zero(s) - fixed #10332: Matrix: last updated fields = today + - fixed Thread subscription groups not cleaned up during purge. 7.7.6 - Added mobile style template. If enabled in settings, will serve alternate style templates diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index cee9574c0..5780f238a 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -602,10 +602,22 @@ sub processPropertiesFromFormPost { } #------------------------------------------------------------------- + +=head2 purge + +Extend the base class to delete from the Thread_read table, and to delete +the subscriptionGroup for this thread. + +=cut + sub purge { - my $self = shift; - $self->session->db->write("delete from Thread_read where threadId=?",[$self->getId]); - $self->SUPER::purge; + my $self = shift; + $self->session->db->write("delete from Thread_read where threadId=?",[$self->getId]); + my $group = WebGUI::Group->new($self->session, $self->get("subscriptionGroupId")); + if ($group) { + $group->delete; + } + $self->SUPER::purge; } #-------------------------------------------------------------------