diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 7b012e0a1..267f1059d 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -188,9 +188,9 @@ sub report_form_ajax : Path('ajax') : Args(0) { my $contribute_as = {}; if ($c->user_exists) { - my $bodies = join(',', keys %{$c->stash->{bodies}}); - my $ca_another_user = $c->user->has_permission_to('contribute_as_another_user', $bodies); - my $ca_body = $c->user->has_permission_to('contribute_as_body', $bodies); + my @bodies = keys %{$c->stash->{bodies}}; + my $ca_another_user = $c->user->has_permission_to('contribute_as_another_user', \@bodies); + my $ca_body = $c->user->has_permission_to('contribute_as_body', \@bodies); $contribute_as->{another_user} = $ca_another_user if $ca_another_user; $contribute_as->{body} = $ca_body if $ca_body; } diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 705e6ee99..4c2d92d5e 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -113,7 +113,7 @@ sub process_user : Private { if ( $c->user_exists ) { { my $user = $c->user->obj; - if ($c->stash->{contributing_as_another_user} = $user->contributing_as('another_user', $c, $update->problem->bodies_str)) { + if ($c->stash->{contributing_as_another_user} = $user->contributing_as('another_user', $c, $update->problem->bodies_str_ids)) { # Act as if not logged in (and it will be auto-confirmed later on) last; } @@ -276,7 +276,7 @@ sub process_update : Private { $update->mark_fixed($params{fixed} ? 1 : 0); $update->mark_open($params{reopen} ? 1 : 0); - $c->stash->{contributing_as_body} = $c->user_exists && $c->user->contributing_as('body', $c, $update->problem->bodies_str); + $c->stash->{contributing_as_body} = $c->user_exists && $c->user->contributing_as('body', $c, $update->problem->bodies_str_ids); if ($c->stash->{contributing_as_body}) { $update->name($c->user->from_body->name); $update->anonymous(0); @@ -286,7 +286,7 @@ sub process_update : Private { } if ( $params{state} ) { - $params{state} = 'fixed - council' + $params{state} = 'fixed - council' if $params{state} eq 'fixed' && $c->user && $c->user->belongs_to_body( $update->problem->bodies_str ); $update->problem_state( $params{state} ); } else { |