diff options
-rwxr-xr-x | web/rss.cgi | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/rss.cgi b/web/rss.cgi index 6b43aeacb..a2ad74721 100755 --- a/web/rss.cgi +++ b/web/rss.cgi @@ -76,19 +76,22 @@ sub rss_local_problems { $state = 'all' unless $state =~ /^(all|open|fixed)$/; $state = 'confirmed' if $state eq 'open'; + # state is getting lost in the redirects. Add it on to the end as a query + $state_qs = '?state=$state' unless $state eq 'all' + my $cobrand = Page::get_cobrand($q); my $base = Cobrand::base_url($cobrand); if ($lat) { # In the UK, it'll never be 0 :) ($e, $n) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G'); $e = int($e + 0.5); $n = int($n + 0.5); - print $q->redirect(-location => "$base/rss/n/$e,$n$d_str"); + print $q->redirect(-location => "$base/rss/n/$e,$n$d_str$state_qs"); return ''; } elsif ($x && $y) { # 5000/31 as initial scale factor for these RSS feeds, now variable so redirect. $e = int( ($x * 5000/31) + 0.5 ); $n = int( ($y * 5000/31) + 0.5 ); - print $q->redirect(-location => "$base/rss/n/$e,$n$d_str"); + print $q->redirect(-location => "$base/rss/n/$e,$n$d_str$state_qs"); return ''; } elsif ($e && $n) { ($lat, $lon) = mySociety::GeoUtil::national_grid_to_wgs84($e, $n, 'G'); @@ -100,7 +103,7 @@ sub rss_local_problems { $error = shift; }; unless ($error) { - print $q->redirect(-location => "$base/rss/n/$e,$n$d_str"); + print $q->redirect(-location => "$base/rss/n/$e,$n$d_str$state_qs"); } return ''; } else { |