diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EmptyHomes.pm | 12 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index da9097ab1..788e57be0 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -833,6 +833,12 @@ sub process_report : Private { $bodies = join( ',', @{ $c->stash->{bodies_to_list} } ) || -1; $report->bodies_str( $bodies ); + my %extra; + $c->cobrand->process_extras( $c, undef, \%extra ); + if ( %extra ) { + $report->extra( \%extra ); + } + } elsif ( $first_area->{id} == COUNCIL_ID_BARNET ) { unless ( exists Utils::barnet_categories()->{ $report->category } ) { diff --git a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm index bc0772c3d..ef27d2c4e 100644 --- a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm +++ b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm @@ -107,6 +107,18 @@ sub council_rss_alert_options { return ( \@options, @reported_to_options ? \@reported_to_options : undef ); } +sub process_extras { + my $self = shift; + my $ctx = shift; + my $body_id = shift; + my $extra = shift; + + my $value = $ctx->request->params->{address} || ''; + $ctx->stash->{field_errors}->{address} = _('This information is required') + unless $value; + $extra->{address} = $value; +} + # A record of the number of reports from the Channel 4 site and other old data sub old_site_stats { return { diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 5bde902d4..24aa12944 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -424,7 +424,7 @@ sub check_for_errors { { $errors{name} = _( 'Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below' - ); + ) unless $self->cobrand eq 'emptyhomes'; } if ( $self->category |