aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Contact.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Contact.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Contact.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm
index b37734e7a..0c9a7c0d8 100644
--- a/perllib/FixMyStreet/DB/Result/Contact.pm
+++ b/perllib/FixMyStreet/DB/Result/Contact.pm
@@ -86,7 +86,15 @@ __PACKAGE__->many_to_many( response_priorities => 'contact_response_priorities',
sub get_metadata_for_input {
my $self = shift;
my $id_field = $self->id_field;
- return [ grep { $_->{code} !~ /^(easting|northing|$id_field)$/ } @{$self->get_extra_fields} ];
+ my @metadata = grep { $_->{code} !~ /^(easting|northing|$id_field)$/ } @{$self->get_extra_fields};
+
+ # Just in case the extra data is in an old parsed format
+ foreach (@metadata) {
+ if (ref $_->{values} eq 'HASH') {
+ $_->{values} = [ map { { name => $_->{name}[0], key => $_->{key}[0] } } @{$_->{values}->{value}} ];
+ }
+ }
+ return \@metadata;
}
sub id_field {