diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-10 14:18:31 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-10 14:18:33 +0000 |
commit | cdd042f4f3ffdfccae6ff9949cc600d63989939c (patch) | |
tree | 24eb2fb7673246fb73daee792a0a715cf59b5a12 | |
parent | 64dd1e896e20f48f3656e0f1fba3779106f2028e (diff) |
Check cached reports have photos before showing.
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 08d2050e6..abbcad42e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## Releases * Unreleased + - Bugfixes + - Check cached reports do still have photos before being shown. * v2.5 (21st December 2018) - Front end improvements: diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index ce64f7ee9..676e721c2 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -154,7 +154,7 @@ sub _recent { # Need to reattach schema so that confirmed column gets reinflated. $probs->[0]->result_source->schema( $rs->result_source->schema ) if $probs->[0]; # Catch any cached ones since hidden - $probs = [ grep { ! $_->is_hidden } @$probs ]; + $probs = [ grep { $_->photo && ! $_->is_hidden } @$probs ]; } else { $probs = [ $rs->search( $query, $attrs )->all ]; Memcached::set($key, $probs, 3600); |