diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-06 17:08:19 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-03-08 17:22:19 +0000 |
commit | 435d15a06bd845bbcadc603b5a9a7ca88b7b403d (patch) | |
tree | d83f45613275b9a8f732c299212cc60e3ff6cf8a /perllib/Open311.pm | |
parent | 36487240bae63833e7e82ac673be92eb9c033d4c (diff) |
[Open311] Use cobrand hook for extra update params
The test has to now create a new comment object each time as
`get_cobrand_logged` is cached on the object.
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index c0e27f96b..749e7ccad 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -29,12 +29,12 @@ has always_send_latlong => ( is => 'ro', isa => Bool, default => 1 ); has send_notpinpointed => ( is => 'ro', isa => Bool, default => 0 ); has extended_description => ( is => 'ro', isa => Str, default => 1 ); has use_service_as_deviceid => ( is => 'ro', isa => Bool, default => 0 ); -has use_extended_updates => ( is => 'ro', isa => Bool, default => 0 ); has extended_statuses => ( is => 'ro', isa => Bool, default => 0 ); has always_send_email => ( is => 'ro', isa => Bool, default => 0 ); has multi_photos => ( is => 'ro', isa => Bool, default => 0 ); has use_customer_reference => ( is => 'ro', isa => Bool, default => 0 ); has mark_reopen => ( is => 'ro', isa => Bool, default => 0 ); +has fixmystreet_body => ( is => 'ro', isa => InstanceOf['FixMyStreet::DB::Result::Body'] ); before [ qw/get_service_list get_service_meta_info get_service_requests get_service_request_updates @@ -387,14 +387,10 @@ sub _populate_service_request_update_params { $params->{phone} = $comment->user->phone if $comment->user->phone; $params->{email} = $comment->user->email if $comment->user->email; + $params->{update_id} = $comment->id; - if ( $self->use_extended_updates ) { - $params->{public_anonymity_required} = $comment->anonymous ? 'TRUE' : 'FALSE', - $params->{update_id_ext} = $comment->id; - $params->{service_request_id_ext} = $comment->problem->id; - } else { - $params->{update_id} = $comment->id; - } + my $cobrand = $self->fixmystreet_body->get_cobrand_handler || $comment->get_cobrand_logged; + $cobrand->call_hook(open311_munge_update_params => $params, $comment, $self->fixmystreet_body); if ( $comment->photo ) { my $cobrand = $comment->get_cobrand_logged; |