diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 6 | ||||
-rw-r--r-- | perllib/Open311/PopulateServiceList.pm | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index f9cbf1c44..c544f084a 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -97,7 +97,11 @@ sub category_display { sub get_metadata_for_input { my $self = shift; my $id_field = $self->id_field; - my @metadata = grep { $_->{code} !~ /^(easting|northing|closest_address|$id_field)$/ } @{$self->get_extra_fields}; + my @metadata = @{$self->get_extra_fields}; + # First, ones we always want to ignore (hard-coded, old system) + @metadata = grep { $_->{code} !~ /^(easting|northing|closest_address|$id_field)$/ } @metadata; + # Also ignore any we have with a 'server_set' automated attribute + @metadata = grep { !$_->{automated} || $_->{automated} ne 'server_set' } @metadata; # Just in case the extra data is in an old parsed format foreach (@metadata) { diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm index af89e3169..30d888eb4 100644 --- a/perllib/Open311/PopulateServiceList.pm +++ b/perllib/Open311/PopulateServiceList.pm @@ -267,8 +267,6 @@ sub _add_meta_to_contact { @meta = grep { ! $ignore{ $_->{ code } } } @meta; } - @meta = grep { !defined $_->{automated} || $_->{ automated } eq 'hidden_field' } @meta; - $contact->set_extra_fields(@meta); $contact->update; } |