diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e3424f3e5..4fb9d1e35 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,6 +1,7 @@ 7.8.3 - fixed #11074: Links to CS posts not working - fixed #11152: Image edits do not autocommit version tags + - fixed template attachments are not cleaned up during purge 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index d9330cf0d..58d6e7610 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -719,9 +719,24 @@ sub processRaw { #------------------------------------------------------------------- +=head2 purge ( ) + +Extend the master to purge attachments in all revisions. + +=cut + +sub purgeRevision { + my $self = shift; + $self->removeAttachments; + $self->session->db->write('delete from template_attachments where templateId=?', [$self->getId]); + return $self->SUPER::purge(@_); +} + +#------------------------------------------------------------------- + =head2 purgeRevision ( ) -Override the master purgeRevision to purge attachments +Extend the master purgeRevision to purge attachments =cut