diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-03-20 09:41:31 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2020-03-31 09:58:58 +0100 |
commit | 1dd6c06a69c9b4c95728aa77d5a2f489996f37b5 (patch) | |
tree | aa4d2a626b0feaeb4e2df483d58dca9673db1275 | |
parent | 0236c8b902f18735006767c94ced9e2f1fdc851f (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.
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 4 |
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 ]; |