aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-03-20 09:41:31 +0000
committerStruan Donald <struan@exo.org.uk>2020-03-31 09:58:58 +0100
commit1dd6c06a69c9b4c95728aa77d5a2f489996f37b5 (patch)
treeaa4d2a626b0feaeb4e2df483d58dca9673db1275 /perllib/FixMyStreet/DB/ResultSet/Problem.pm
parent0236c8b902f18735006767c94ced9e2f1fdc851f (diff)
Recent reports, use same query regardless of cache
If you called this function not asking for photos, the result if fetched from the cache would only allow through ones with photos.
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 996e990a8..5b2079831 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -158,9 +158,7 @@ sub _recent {
# Need to refetch to check if hidden since cached
$probs = [ $rs->search({
id => [ map { $_->id } @$probs ],
- photo => { '!=', undef },
- non_public => 'f',
- state => [ FixMyStreet::DB::Result::Problem->visible_states() ],
+ %$query,
})->all ];
} else {
$probs = [ $rs->search( $query, $attrs )->all ];