aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm13
2 files changed, 6 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32f05c9de..0e73a903a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,7 @@
- Superusers without a from_body can make reports again. #1913
- Fix crash when viewing /around in certain locales. #1916
- Fix back bug, from report after using list filters. #1920
+ - Fix issues with send method category change. #1933
- Admin improvements:
- Character length limit can be placed on report detailed information #1848
- Inspector panel shows nearest address if available #1850
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);
}