aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-10-18 16:22:08 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-18 16:22:08 +0100
commit3a2b49ebcb8c65d73108930f421142f2536cb893 (patch)
tree0112c0481384bd8fdc4e3b74efc1c6fd991e40b6 /perllib/FixMyStreet/App.pm
parentfc507074651b9f70dab1eeed4772f678a21fe272 (diff)
Update pagination when status/categories changed.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r--perllib/FixMyStreet/App.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index ab5e62233..7809b5f12 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -346,13 +346,21 @@ sub send_email {
$uri = $c->uri_with( ... );
-Simply forwards on to $c->req->uri_with - this is a common typo I make!
+Forwards on to $c->req->uri_with, but also deletes keys that have a "" value
+(as undefined is passed as that from a template).
=cut
sub uri_with {
my $c = shift;
- return $c->req->uri_with(@_);
+ my $uri = $c->req->uri_with(@_);
+ my $args = $_[0];
+ my %params = %{$uri->query_form_hash};
+ foreach my $key (keys %$args) {
+ delete $params{$key} if $args->{$key} eq "";
+ }
+ $uri->query_form(\%params);
+ return $uri;
}
=head2 uri_for