diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 11 | ||||
-rw-r--r-- | web/cobrands/westminster/assets.js | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index c41b65e2a..103509863 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1025,7 +1025,16 @@ sub process_report : Private { my $body_string = do { if (my $single_body_only = $c->get_param('single_body_only')) { my $body = $c->model('DB::Body')->search({ name => $single_body_only })->first; - $body ? $body->id : '-1'; + if ($body) { + # Drop the contacts down to those in this body + # (potentially none for e.g. Highways England) + # so that set_report_extras doesn't error when + # there are 'missing' extra fields + @contacts = grep { $_->body->id == $body->id } @contacts; + $body->id; + } else { + '-1'; + } } else { my $contact_options = {}; $contact_options->{do_not_send} = [ $c->get_param_list('do_not_send', 1) ]; diff --git a/web/cobrands/westminster/assets.js b/web/cobrands/westminster/assets.js index de6e7c4c6..1c0358301 100644 --- a/web/cobrands/westminster/assets.js +++ b/web/cobrands/westminster/assets.js @@ -101,6 +101,7 @@ fixmystreet.assets.add(defaults, { found: function(layer, feature) { if (!fixmystreet.assets.selectedFeature()) { fixmystreet.body_overrides.only_send('TfL'); + $('#category_meta').empty(); } else { fixmystreet.body_overrides.remove_only_send(); } |