aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Contact.pm10
2 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 7822f5cf3..2246f6aea 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1077,7 +1077,7 @@ sub set_report_extras : Private {
my ($self, $c, $contacts, $param_prefix) = @_;
$param_prefix ||= "";
- my @metalist = map { [ $_->get_metadata_for_input, $param_prefix ] } @$contacts;
+ my @metalist = map { [ $_->get_metadata_for_storage, $param_prefix ] } @$contacts;
push @metalist, map { [ $_->get_extra_fields, "extra[" . $_->id . "]" ] } @{$c->stash->{report_extra_fields}};
my @extra;
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm
index 17620f279..3ce0ec66f 100644
--- a/perllib/FixMyStreet/DB/Result/Contact.pm
+++ b/perllib/FixMyStreet/DB/Result/Contact.pm
@@ -121,6 +121,16 @@ sub get_metadata_for_input {
return \@metadata;
}
+sub get_metadata_for_storage {
+ my $self = shift;
+ my $metadata = $self->get_metadata_for_input;
+
+ # Also ignore any that were only for textual display
+ my @metadata = grep { ($_->{variable} || '') ne 'false' } @$metadata;
+
+ return \@metadata;
+}
+
sub id_field {
my $self = shift;
return $self->get_extra_metadata('id_field') || 'fixmystreet_id';