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/Cobrand/Default.pm9
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm5
3 files changed, 15 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index b3b5d00fd..e2569d2e9 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -913,7 +913,7 @@ sub set_report_extras : Private {
foreach my $contact (@$contacts) {
my $metas = $contact->get_metadata_for_input;
foreach my $field ( @$metas ) {
- if ( lc( $field->{required} ) eq 'true' ) {
+ if ( lc( $field->{required} ) eq 'true' && !$c->cobrand->category_extra_hidden($field->{code})) {
unless ( $c->get_param($param_prefix . $field->{code}) ) {
$c->stash->{field_errors}->{ $field->{code} } = _('This information is required');
}
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 13d5cb8f1..a2ca9f8c1 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -1177,4 +1177,13 @@ sub lookup_by_ref_regex {
return qr/^\s*ref:\s*(\d+)\s*$/;
}
+=head2 category_extra_hidden
+
+Return true if an Open311 service attribute should be a hidden field.
+=cut
+
+sub category_extra_hidden {
+ my ($self, $meta) = @_;
+}
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index 206f4bb1e..08ecf0b7d 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -396,5 +396,10 @@ sub lookup_by_ref_regex {
return qr/^\s*(\d+)\s*$/;
}
+sub category_extra_hidden {
+ my ($self, $meta) = @_;
+ return 1 if $meta eq 'usrn' || $meta eq 'asset_id';
+ return 0;
+}
1;