aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm5
-rw-r--r--t/app/model/problem.t4
2 files changed, 6 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 3bf41035e..5499af474 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -340,7 +340,10 @@ sub send_reports {
# XXX Only copes with at most one missing body
my ($bodies, $missing) = $row->bodies_str =~ /^([\d,]+)(?:\|(\d+))?/;
my @bodies = split(/,/, $bodies);
- $bodies = FixMyStreet::App->model("DB::Body")->search({ id => \@bodies });
+ $bodies = FixMyStreet::App->model("DB::Body")->search(
+ { id => \@bodies },
+ { order_by => 'name' },
+ );
$missing = FixMyStreet::App->model("DB::Body")->find($missing) if $missing;
my @dear;
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index 7303eedac..fa8cf89ae 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -465,8 +465,8 @@ foreach my $test ( {
desc => 'email to two tier council',
unset_whendef => 1,
email_count => 1,
- to => qr'Gloucestershire County Council.*Cheltenham Borough Council',
- dear => qr'Dear Gloucestershire County Council and Cheltenham Borough',
+ to => qr'Cheltenham Borough Council.*Gloucestershire County Council',
+ dear => qr'Dear Cheltenham Borough Council and Gloucestershire County',
body => '2226,2326',
multiple => 1,
}, {