aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-08-02 16:05:07 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-08-03 21:35:40 +0100
commit9f341adabd2a22de7e13c43e860bb3741017bf58 (patch)
treed7425fac88493195b0acfbe8d40e2ae751cb1daa
parent7e2463f04c67091423dcfb3eec3536d4791103e1 (diff)
[Buckinghamshire] Fix hard-coded category lookup.
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Buckinghamshire.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 5d24bc980..bed69431a 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -636,7 +636,7 @@ sub setup_categories_and_bodies : Private {
= $c #
->model('DB::Contact') #
->active
- ->search( { body_id => [ keys %bodies ] }, { prefetch => 'body' } );
+ ->search( { 'me.body_id' => [ keys %bodies ] }, { prefetch => 'body' } );
my @contacts = $c->cobrand->categories_restriction($contacts)->all;
# variables to populate
diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
index 11b52174a..c910756cc 100644
--- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm
@@ -334,7 +334,7 @@ sub categories_restriction {
my ($self, $rs) = @_;
# Buckinghamshire is a two-tier council, but only want to display
# county-level categories on their cobrand.
- return $rs->search( { 'body.id' => 2217 } );
+ return $rs->search( { 'body_areas.area_id' => 2217 }, { join => { body => 'body_areas' } });
}
sub lookup_site_code {