diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-02-23 13:45:58 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-02-23 16:22:12 +0000 |
commit | 3bc248986218229c7de2d2669c85676ec29f4591 (patch) | |
tree | 36685d4886156d49f1f0f4b9cbe557e765dd6761 | |
parent | f96e9a53bc80c6fb6eab0966b5d953dc0fbbab12 (diff) |
[UK] Improve Open311 update Bromley-only check.
The addition of e.g. questionnaire_id to an update's
extra field means this check has to be more nuanced.
-rw-r--r-- | perllib/Open311.pm | 3 | ||||
-rw-r--r-- | t/open311.t | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index f4229d7ed..44af0b134 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -355,7 +355,8 @@ sub _populate_service_request_update_params { $params->{media_url} = $url; } - if ( $comment->extra ) { + # The following will only set by UK in Bromley/Bromley cobrands + if ( $comment->extra && $comment->extra->{title} ) { $params->{'email_alerts_requested'} = $comment->extra->{email_alerts_requested} ? 'TRUE' : 'FALSE'; $params->{'title'} = $comment->extra->{title}; diff --git a/t/open311.t b/t/open311.t index b41d42b55..35d9b0ecb 100644 --- a/t/open311.t +++ b/t/open311.t @@ -482,7 +482,7 @@ for my $test ( desc => 'update name taken from extra if available', comment_name => 'First Last', user_name => 'Personal Family', - extra => { first_name => 'Forename', last_name => 'Surname' }, + extra => { first_name => 'Forename', last_name => 'Surname', title => 'Ms' }, first_name => 'Forename', last_name => 'Surname' }, |