aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Alert.pm2
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm13
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm2
-rw-r--r--perllib/Open311.pm2
-rw-r--r--perllib/Utils.pm1
6 files changed, 16 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm
index 4e5319a59..91ea61fbc 100644
--- a/perllib/FixMyStreet/App/Controller/Alert.pm
+++ b/perllib/FixMyStreet/App/Controller/Alert.pm
@@ -438,7 +438,7 @@ sub determine_location : Private {
$c->detach('choose');
}
- $c->go('index') if $c->stash->{location_error};
+ $c->go('index');
}
# truncate the lat,lon for nicer urls
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index fe4b652ed..baaa3b927 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -106,10 +106,19 @@ sub local_problems_pc_distance : Path('pc') : Args(2) {
}
-sub local_problems : LocalRegex('^(n|l)/([\d.-]+)[,/]([\d.-]+)(?:/(\d+))?$') {
+sub local_problems_dist : LocalRegex('^(n|l)/([\d.-]+)[,/]([\d.-]+)/(\d+)$') {
my ( $self, $c ) = @_;
+ $c->forward( 'local_problems', $c->req->captures );
+}
+
+sub local_problems_no_dist : LocalRegex('^(n|l)/([\d.-]+)[,/]([\d.-]+)$') {
+ my ( $self, $c ) = @_;
+ $c->forward( 'local_problems', $c->req->captures );
+}
+
+sub local_problems : Private {
+ my ( $self, $c, $type, $a, $b, $d ) = @_;
- my ( $type, $a, $b, $d) = @{ $c->req->captures };
$c->forward( 'get_query_parameters', [ $d ] );
$c->detach( 'redirect_lat_lon', [ $a, $b ] )
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index b9a893778..a6c9c6fba 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -697,7 +697,7 @@ If set to an arrayref, will plot those area ID(s) from mapit on all the /around
=cut
-sub areas_on_around {}
+sub areas_on_around { []; }
sub process_extras {}
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index dfdce641e..58da5166c 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -45,7 +45,7 @@ sub process_extras {
my $extra = shift;
my $fields = shift || [];
- if ( $area_id == 2482 ) {
+ if ( $area_id eq '2482' ) {
my @fields = ( 'fms_extra_title', @$fields );
for my $field ( @fields ) {
my $value = $ctx->request->param( $field );
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index ef430d628..603eae777 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -419,7 +419,7 @@ sub _get_xml_object {
my $obj;
eval {
- $obj = $simple ->XMLin( $xml );
+ $obj = $simple ->parse_string( $xml );
};
return $obj;
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index 09c7386b4..ab7bc6e12 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -241,6 +241,7 @@ sub cleanup_text {
sub prettify_epoch {
my ( $epoch, $type ) = @_;
+ $type ||= '';
$type = 'short' if $type eq '1';
my $dt = DateTime->from_epoch( epoch => $epoch, time_zone => 'local' );