aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-10-10 17:11:03 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-10-10 17:11:03 +0100
commite5b4e68cb0ff30f65303d85743f0baf0658b0b9e (patch)
tree24f33faffb38c76047ecca72cdae9bac41f26b0a /perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
parent4dfa21702275d385f959a740b17ae7b41ed98565 (diff)
Email template language paths weren't being looked at for questionnaires or reports (wasn't used, but didn't want to cause confusion at some future time). Prompted by #164.
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
index bbf0c9a9e..d6b3eb5cb 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
@@ -62,7 +62,9 @@ sub send_questionnaires_period {
($template = $period) =~ s/ //;
$template = Utils::read_file( FixMyStreet->path_to( "templates/email/emptyhomes/" . $row->lang . "/questionnaire-$template.txt" )->stringify );
} else {
- $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, "questionnaire.txt" )->stringify;
+ $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, $row->lang, "questionnaire.txt" )->stringify;
+ $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, "questionnaire.txt" )->stringify
+ unless -e $template;
$template = FixMyStreet->path_to( "templates", "email", "default", "questionnaire.txt" )->stringify
unless -e $template;
$template = Utils::read_file( $template );