Skip to content

Commit

Permalink
do not override template when displaying body contacts as text
Browse files Browse the repository at this point in the history
move setting the body template to before `fetch_contacts` so it doesn't
override setting the text only email address template.

Fixes #1895
  • Loading branch information
struan committed Nov 7, 2017
1 parent a26652e commit 9d50dcb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@
- Always allow reports to be removed from shortlist #1882
- Remove shortlist form from inspect duplicate list.
- Fix pin size when JavaScript unavailable.
- Fix display of text only body contacts #1895
- Admin improvements:
- Character length limit can be placed on report detailed information #1848
- Inspector panel shows nearest address if available #1850
Expand Down
5 changes: 4 additions & 1 deletion perllib/FixMyStreet/App/Controller/Admin.pm
Expand Up @@ -608,9 +608,12 @@ sub edit_body : Chained('body') : PathPart('') : Args(0) {
$c->set_param('posted', '');

$c->forward('fetch_translations');
$c->forward('fetch_contacts');

# don't set this last as fetch_contacts might over-ride it
# to display email addresses as text
$c->stash->{template} = 'admin/body.html';
$c->forward('fetch_contacts');

return 1;
}

Expand Down
1 change: 1 addition & 0 deletions t/app/controller/admin.t
Expand Up @@ -289,6 +289,7 @@ subtest 'check text output' => sub {
$mech->get_ok('/admin/body/' . $body->id . '?text=1');
is $mech->content_type, 'text/plain';
$mech->content_contains('test category');
$mech->content_lacks('<body');
};


Expand Down

0 comments on commit 9d50dcb

Please sign in to comment.