diff options
author | Struan Donald <struan@exo.org.uk> | 2011-08-04 00:21:42 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-08-04 00:21:42 +0100 |
commit | 3700dca455e552ff5846949b972f4be6cf7337dd (patch) | |
tree | 242cde5782ec45375337577caf943342838b8cdf /perllib/FixMyStreet/App/Controller/Report | |
parent | ce4d421f65f2f4df0abf07719cc5dc9320ea6ad1 (diff) |
yet another attempt at storing the service detail information
this time we sort as we store so we don't need to do this every time we
display the information
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 63add43ee..d418becb9 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -500,7 +500,7 @@ sub setup_categories_and_councils : Private { unless ( $seen{$contact->category} ) { push @category_options, $contact->category; - $category_extras{ $contact->category } = [ values %{$contact->extra} ] + $category_extras{ $contact->category } = $contact->extra if $contact->extra; } $seen{$contact->category} = 1; @@ -517,7 +517,8 @@ sub setup_categories_and_councils : Private { $c->stash->{area_ids_to_list} = [ keys %area_ids_to_list ]; $c->stash->{category_label} = $category_label; $c->stash->{category_options} = \@category_options; - $c->stash->{category_extras} = encode_json \%category_extras; + $c->stash->{category_extras} = \%category_extras; + $c->stash->{category_extras_json} = encode_json \%category_extras; my @missing_details_councils = grep { !$area_ids_to_list{$_} } # @@ -699,7 +700,7 @@ sub process_report : Private { my @extra = (); my $metas = $contacts[0]->extra; - foreach my $field ( sort { $a->{order} <=> $b->{order} } values %$metas ) { + foreach my $field ( @$metas ) { if ( lc( $field->{required} ) eq 'true' ) { unless ( $c->request->param( $field->{code} ) ) { $c->stash->{field_errors}->{ $field->{code} } = _('This information is required'); |