diff options
author | Struan Donald <struan@exo.org.uk> | 2019-04-09 13:00:50 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-04-09 13:00:50 +0100 |
commit | aabed59c3822f6053e131d28e2b66ea363ca215e (patch) | |
tree | 726684a68e03b5f81bbf8fb763caa020443f04ac /perllib | |
parent | 06809a5c80c4c04f0a4cbae398bae8609038dfed (diff) |
[Open311] handle bad FixMyStreet id in updates
If an update has a fixmystreet id in it check that it looks like an
integer and if not issue a warning and skip the update.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 06b5ce321..263877e0a 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -108,6 +108,11 @@ sub update_comments { # in some cases we only have the FMS id and not the request id so use that if ( $request->{fixmystreet_id} ) { + unless ( $request->{fixmystreet_id} =~ /^\d+$/ ) { + warn "skipping bad fixmystreet id in updates for " . $body->name . ": [" . $request->{fixmystreet_id} . "], external id is $request_id\n"; + next; + } + $criteria = { id => $request->{fixmystreet_id}, }; |