diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-12-13 13:35:12 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-12-13 13:35:12 +0000 |
commit | 5a6d30ba74e70412593398b43e4c5e5c938c1d4c (patch) | |
tree | 0b48ac48f1914a4091b6312fc175ce0849012c37 /perllib/FixMyStreet/App/Controller/Admin.pm | |
parent | c6dd57095435257b1a37e424c4170d37a1c82a37 (diff) | |
parent | f982c8f38d192c7d4c3304ab5617df01be4176a6 (diff) |
Merge branch 'issues/forcouncils/261-rdi-check'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index e21b0cc2f..7b9bd6e96 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -960,17 +960,14 @@ sub report_edit_category : Private { $problem->whensent(undef); } # If the send methods of the old/new contacts differ we need to resend the report - my @old_contacts = grep { $_->category eq $category_old } @{$c->stash->{contacts}}; my @new_send_methods = uniq map { ( $_->body->can_be_devolved && $_->send_method ) ? - $_->send_method : $_->body->send_method; + $_->send_method : $_->body->send_method + ? $_->body->send_method + : $c->cobrand->_fallback_body_sender()->{method}; } @contacts; - my @old_send_methods = map { - ( $_->body->can_be_devolved && $_->send_method ) ? - $_->send_method : $_->body->send_method; - } @old_contacts; - if ( scalar @{ mySociety::ArrayUtils::symmetric_diff(\@old_send_methods, \@new_send_methods) } ) { - $c->log->debug("Report changed, resending"); + my %old_send_methods = map { $_ => 1 } split /,/, ($problem->send_method_used || "Email"); + if (grep !$old_send_methods{$_}, @new_send_methods) { $problem->whensent(undef); } |