aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/GetServiceRequests.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-04-04 17:36:06 +0100
committerDave Arter <davea@mysociety.org>2018-04-04 17:37:26 +0100
commit6666bcd1157e1aa5e6ea336339dc89c516267b15 (patch)
treedca4823d8308ab1168ae0ed4585ac8734c4ecc9f /perllib/Open311/GetServiceRequests.pm
parent49289d4f231b570004ed4dd4d54ffe1d2d172623 (diff)
Correctly assign problem categories in GetServiceRequests
FMS uses the Contact->email field for the Open311 service code, and the Contact->category field is the user-friendly service name. The wrong value was being compared previously, resulting in all fetched problems being assigned to the 'Other' category.
Diffstat (limited to 'perllib/Open311/GetServiceRequests.pm')
-rw-r--r--perllib/Open311/GetServiceRequests.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/Open311/GetServiceRequests.pm b/perllib/Open311/GetServiceRequests.pm
index b1cb0c4dc..78e9647fa 100644
--- a/perllib/Open311/GetServiceRequests.pm
+++ b/perllib/Open311/GetServiceRequests.pm
@@ -137,7 +137,7 @@ sub create_problems {
};
$problems = $self->schema->resultset('Problem')->to_body($body)->search( $criteria );
- my @contacts = grep { $request->{service_code} eq $_->category } $contacts->all;
+ my @contacts = grep { $request->{service_code} eq $_->email } $contacts->all;
my $contact = $contacts[0] ? $contacts[0]->category : 'Other';
my $state = $open311->map_state($request->{status});