aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Triage.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm8
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
4 files changed, 5 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Triage.pm b/perllib/FixMyStreet/App/Controller/Admin/Triage.pm
index 50d1b1437..0eabd340d 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Triage.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Triage.pm
@@ -57,8 +57,7 @@ sub index : Path : Args(0) {
my @categories = $c->stash->{body}->contacts->not_deleted->search( undef, {
columns => [ 'id', 'category', 'extra' ],
distinct => 1,
- order_by => [ 'category' ],
- } )->all;
+ } )->all_sorted;
$c->stash->{filter_categories} = \@categories;
$c->stash->{filter_category} = { map { $_ => 1 } $c->get_param_list('filter_category', 1) };
my $pins = $c->stash->{pins} || [];
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index f14d116cc..377449719 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -248,10 +248,9 @@ sub check_and_stash_category : Private {
$where,
{
columns => [ 'category', 'extra' ],
- order_by => [ 'category' ],
distinct => 1
}
- )->all;
+ )->all_sorted;
$c->stash->{filter_categories} = \@categories;
my %categories_mapped = map { $_->category => 1 } @categories;
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 612c76c0c..8dec06e86 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -7,7 +7,6 @@ BEGIN { extends 'Catalyst::Controller'; }
use Encode;
use List::MoreUtils qw(uniq);
use List::Util 'first';
-use POSIX 'strcoll';
use HTML::Entities;
use Path::Class;
use Utils;
@@ -285,7 +284,7 @@ sub by_category_ajax_data : Private {
if ( $c->stash->{category_extras}->{$category} && @{ $c->stash->{category_extras}->{$category} } >= 1 ) {
my $disable_form = $c->forward('disable_form_message');
- $body->{disable_form} = $disable_form if $disable_form;
+ $body->{disable_form} = $disable_form if %$disable_form;
}
my $unresponsive = $c->stash->{unresponsive}->{$category};
@@ -677,7 +676,7 @@ sub setup_categories_and_bodies : Private {
->model('DB::Contact') #
->active
->search( { 'me.body_id' => [ keys %bodies ] }, { prefetch => 'body' } );
- my @contacts = $c->cobrand->categories_restriction($contacts)->all;
+ my @contacts = $c->cobrand->categories_restriction($contacts)->all_sorted;
# variables to populate
my %bodies_to_list = (); # Bodies with categories assigned
@@ -703,9 +702,6 @@ sub setup_categories_and_bodies : Private {
$c->stash->{unresponsive}{$k} = { map { $_ => 1 } keys %bodies };
}
- # keysort does not appear to obey locale so use strcoll (see i18n.t)
- @contacts = sort { strcoll( $a->category, $b->category ) } @contacts;
-
my %seen;
foreach my $contact (@contacts) {
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 85e647f65..271513df3 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -187,8 +187,7 @@ sub setup_categories_and_map :Private {
my @categories = $c->stash->{body}->contacts->not_deleted->search( undef, {
columns => [ 'id', 'category', 'extra', 'body_id', 'send_method' ],
distinct => 1,
- order_by => [ 'category' ],
- } )->all;
+ } )->all_sorted;
$c->cobrand->call_hook('munge_reports_category_list', \@categories);