aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/AlertType.pm3
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm5
2 files changed, 6 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
index a2784950a..cc4fc67fc 100644
--- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
@@ -58,6 +58,7 @@ sub email_alerts ($) {
while (my $row = $query->fetchrow_hashref) {
my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($row->{alert_cobrand})->new();
+ $cobrand->set_lang_and_domain( $row->{alert_lang}, 1, FixMyStreet->path_to('locale')->stringify );
# Cobranded and non-cobranded messages can share a database. In this case, the conf file
# should specify a vhost to send the reports for each cobrand, so that they don't get sent
@@ -204,7 +205,7 @@ sub _send_aggregated_alert_email(%) {
my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($data{cobrand})->new();
- $cobrand->set_lang_and_domain( $data{lang}, 1 );
+ $cobrand->set_lang_and_domain( $data{lang}, 1, FixMyStreet->path_to('locale')->stringify );
if (!$data{alert_email}) {
my $user = FixMyStreet::App->model('DB::User')->find( {
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;