diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Location.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/UKCouncilWMTS.pm | 1 |
5 files changed, 6 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 047d15fe3..bd45ad55e 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -73,6 +73,9 @@ sub index : Path : Args(0) { bodies_str => { '!=', undef }, # Ignore very recent ones that probably just haven't been sent yet confirmed => { '<', \"current_timestamp - '5 minutes'::interval" }, + }, + { + order_by => 'confirmed', } )->all; $c->stash->{unsent_reports} = \@unsent; diff --git a/perllib/FixMyStreet/App/Controller/Location.pm b/perllib/FixMyStreet/App/Controller/Location.pm index 81c2c33fc..416fb942a 100644 --- a/perllib/FixMyStreet/App/Controller/Location.pm +++ b/perllib/FixMyStreet/App/Controller/Location.pm @@ -112,7 +112,7 @@ sub determine_location_from_pc : Private { # Log failure in a log db try { my $dbfile = FixMyStreet->path_to('../data/analytics.sqlite'); - my $db = DBI->connect("dbi:SQLite:dbname=$dbfile", undef, undef) or die "$DBI::errstr\n"; + my $db = DBI->connect("dbi:SQLite:dbname=$dbfile", undef, undef, { PrintError => 0 }) or die "$DBI::errstr\n"; my $sth = $db->prepare("INSERT INTO location_searches_with_no_results (datetime, cobrand, geocoder, url, user_input) VALUES (?, ?, ?, ?, ?)") or die $db->errstr . "\n"; diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index faa02f9fe..1a300da21 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1247,7 +1247,7 @@ sub check_for_errors : Private { if ( $c->cobrand->allow_anonymous_reports ) { my $anon_details = $c->cobrand->anonymous_account; $report->user->email(undef) if $report->user->email eq $anon_details->{email}; - $report->name(undef) if $report->name eq $anon_details->{name}; + $report->name(undef) if $report->name && $report->name eq $anon_details->{name}; } return; diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index e44577bab..a9f8c2f01 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -93,15 +93,6 @@ sub geocode_postcode { return {}; } -sub remove_redundant_areas { - my $self = shift; - my $all_areas = shift; - - # Norwich is responsible for everything in its areas, not Norfolk - delete $all_areas->{2233} # - if $all_areas->{2391}; -} - sub short_name { my $self = shift; my ($area) = @_; diff --git a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm index 7e3522714..53b6859bf 100644 --- a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm +++ b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm @@ -45,6 +45,7 @@ sub reproject_from_latlon($$$) { # Reproject a BNG easting/northing into WGS84 lat/lon sub reproject_to_latlon($$$) { my ($self, $x, $y) = @_; + return (0,0) if $x<0 || $y<0; my ($lat, $lon) = Utils::convert_en_to_latlon($x, $y); return ($lat, $lon); } |