diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-01-18 23:44:15 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-01-18 23:44:15 +0000 |
commit | 41e3134805b6ab9f0db849607d44d4e145e554c1 (patch) | |
tree | dbaf61ad3fdd2084d184ce5984789abbf29b5d85 /web/rss.cgi | |
parent | a1f9b9d2422f4b14f79ed40fbd70f18510dfedf2 (diff) | |
parent | 66a14c3f2d63db568e4b4cf82f4abfdfcbb9edfd (diff) |
Merge branch 'master' into cities_release_1
Diffstat (limited to 'web/rss.cgi')
-rwxr-xr-x | web/rss.cgi | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web/rss.cgi b/web/rss.cgi index 6b43aeacb..a716d93e9 100755 --- a/web/rss.cgi +++ b/web/rss.cgi @@ -74,6 +74,10 @@ sub rss_local_problems { $d_str = "/$d" if $d; my $state = $q->param('state') || 'all'; $state = 'all' unless $state =~ /^(all|open|fixed)$/; + + # state is getting lost in the redirects. Add it on to the end as a query + my $state_qs = "?state=$state" unless $state eq 'all'; + $state = 'confirmed' if $state eq 'open'; my $cobrand = Page::get_cobrand($q); @@ -82,13 +86,13 @@ sub rss_local_problems { ($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 +104,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 { |