aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-01-21 16:24:25 +0000
committerStruan Donald <struan@exo.org.uk>2013-01-21 16:24:25 +0000
commitce9afa6c9e362e84dbdb46fffcdc47a4c3185ad5 (patch)
treedfb445e4f0f8a32e8d088dff61dbbe6210d8b296 /perllib/Open311
parent2b7c3be2e3c668c4a8951e0e863317d528bfdc2c (diff)
parentcfab135387e614ceb66f5e87614f16febcbe4ce6 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'perllib/Open311')
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index e337c0f57..10c8b07e3 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -80,12 +80,14 @@ sub update_comments {
# what problem it belongs to so just skip
next unless $request_id;
- my $problem =
- FixMyStreet::App->model('DB::Problem')
- ->search( {
- external_id => $request_id,
- council => { like => '%' . $council_details->{areaid} . '%' },
- } );
+ my $problem;
+ my $criteria = { external_id => $request_id };
+ if ($open311->jurisdiction =~ /^fixmybarangay_(dps|dpwh|depw)$/i) { # use jurisdiction (not area_id) for FMB bodies
+ $criteria->{ external_body } = uc $1;
+ } else {
+ $criteria->{ council } = { like => '%' . $council_details->{areaid} . '%' };
+ }
+ $problem = FixMyStreet::App->model('DB::Problem')->search( $criteria );
if (my $p = $problem->first) {
my $c = $p->comments->search( { external_id => $request->{update_id} } );