diff options
author | Struan Donald <struan@exo.org.uk> | 2011-08-01 18:54:07 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-08-01 18:54:07 +0100 |
commit | 6d38f3aeaa6f4eb0f51a773658cb4923d45f6968 (patch) | |
tree | 0b331bad65d9faef2dfa22af90b7cb1d0a9b05ed /perllib/FixMyStreet/App/Controller/Report | |
parent | 720fc7ff7f9a375389ae4ba67bb56ce55587363a (diff) |
slight neatening of data structure and some html tidy up
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index cd943070d..5cf634e14 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -692,7 +692,7 @@ sub process_report : Private { my @extra = (); my $metas = $contacts[0]->extra; - foreach my $field ( @{ $metas->{attribute} } ) { + foreach my $field ( sort { $a->{order} <=> $b->{order} } values %$metas ) { if ( lc( $field->{required} ) eq 'true' ) { unless ( $c->request->param( $field->{code} ) ) { $c->stash->{field_errors}->{ $field->{code} } = _('This information is required'); @@ -705,8 +705,10 @@ sub process_report : Private { }; } - $c->stash->{report_meta} = \@extra if @extra; - $report->extra( \@extra ) if @extra; + if ( @extra ) { + $c->stash->{report_meta} = \@extra; + $report->extra( \@extra ); + } } elsif ( @{ $c->stash->{area_ids_to_list} } ) { # There was an area with categories, but we've not been given one. Bail. |