diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-10-09 12:52:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-10-09 12:52:39 +0100 |
commit | cd73cde53e8fd5114161df5b3d826ae09e954b49 (patch) | |
tree | 1ce9641ef340f6cbbca0cf2e40aa1c0a9d2d3ef6 | |
parent | 0364c15d2bded77c07c965e05a13a47e3d8de7ce (diff) |
[Open311] protected is true/false string, not boolean.
-rw-r--r-- | perllib/Open311/PopulateServiceList.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm index e58f51be6..6fdc4ce3d 100644 --- a/perllib/Open311/PopulateServiceList.pm +++ b/perllib/Open311/PopulateServiceList.pm @@ -162,7 +162,7 @@ sub _handle_existing_contact { } elsif ( $contact and $contact->extra and lc($metadata) eq 'false' ) { # check if there are any protected fields that we should not delete my @meta = ( - grep { $_->{protected} } + grep { ($_->{protected} || '') eq 'true' } @{ $contact->get_extra_fields } ); $contact->set_extra_fields(@meta); @@ -233,7 +233,7 @@ sub _add_meta_to_contact { # check if there are any protected fields that we should not overwrite my $protected = { map { $_->{code} => $_ } - grep { $_->{protected} } + grep { ($_->{protected} || '') eq 'true' } @{ $contact->get_extra_fields } }; my @meta = @@ -246,7 +246,7 @@ sub _add_meta_to_contact { # turn the data into something a bit more friendly to use @meta = # remove trailing colon as we add this when we display so we don't want 2 - map { $_->{description} =~ s/:\s*$//; $_ } + map { $_->{description} =~ s/:\s*$// if $_->{description}; $_ } # there is a display order and we only want to sort once sort { $a->{order} <=> $b->{order} } @meta; |