From 1dd6c06a69c9b4c95728aa77d5a2f489996f37b5 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 20 Mar 2020 09:41:31 +0000 Subject: 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. --- perllib/FixMyStreet/DB/ResultSet/Problem.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm') 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 ]; -- cgit v1.2.3