aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Model/PhotoSet.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-04-26 13:41:36 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-05-07 15:30:12 +0100
commit332c92ead825503c0540f805a0fdb39c64212c15 (patch)
tree1d181c7321b7e42c2cc1f7188ae1a4dee908f228 /perllib/FixMyStreet/App/Model/PhotoSet.pm
parent8246580437ca944f361789dc72bf74b624f06c36 (diff)
If report hidden, also purge update photos cache.
Diffstat (limited to 'perllib/FixMyStreet/App/Model/PhotoSet.pm')
-rw-r--r--perllib/FixMyStreet/App/Model/PhotoSet.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Model/PhotoSet.pm b/perllib/FixMyStreet/App/Model/PhotoSet.pm
index 58b352c73..8621286b0 100644
--- a/perllib/FixMyStreet/App/Model/PhotoSet.pm
+++ b/perllib/FixMyStreet/App/Model/PhotoSet.pm
@@ -235,7 +235,7 @@ sub get_image_data {
}
sub delete_cached {
- my ($self) = @_;
+ my ($self, %params) = @_;
my $object = $self->object or return;
my $id = $object->id or return;
@@ -256,6 +256,11 @@ sub delete_cached {
unlink FixMyStreet->path_to(@dirs, "$id.$i$size.$type");
}
}
+
+ # Loop through all the updates as well if requested
+ if ($params{plus_updates}) {
+ $_->get_photoset->delete_cached() foreach $object->comments->all;
+ }
}
sub remove_images {