aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Model/PhotoSet.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-05-09 09:44:08 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-05-09 09:44:08 +0100
commitc25332f3c0a6201726882c9d5b69bf314b5d061d (patch)
tree71a047bf42a22fab0ea3dd076490ef45510605c3 /perllib/FixMyStreet/App/Model/PhotoSet.pm
parent47b754d7a8dd1114eb745efcaf1495fb27f0c1d8 (diff)
parent332c92ead825503c0540f805a0fdb39c64212c15 (diff)
Merge branch 'photo-caching'
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 {