diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-01-14 15:47:06 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-01-21 14:17:14 +0000 |
commit | e5161c960c9a42c5bbef2445281c8cd374dc9dc3 (patch) | |
tree | 5b506528dab64e27ccd925a64274ad3964f6a353 /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | a453f19261ece91842972f7d11235050c6309049 (diff) |
Filter contacts before constructing options.
If we wait until after to filter the contacts and the constructed
options, then we can end up in the situation where e.g. we've filtered
out all the TfL contacts but the category option is still the TfL one
(with its associated group).
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index cbbf8971a..ba37a25fa 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -691,6 +691,8 @@ sub setup_categories_and_bodies : Private { ->search( { 'me.body_id' => [ keys %bodies ] }, { prefetch => 'body' } ); my @contacts = $c->cobrand->categories_restriction($contacts)->all_sorted; + $c->cobrand->call_hook(munge_report_new_contacts => \@contacts); + # variables to populate my %bodies_to_list = (); # Bodies with categories assigned my @category_options = (); # categories to show |