diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-10-07 12:06:54 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-10-07 12:06:56 +0100 |
commit | 043bce556a17545c2c26386d8368f47ba8f541e6 (patch) | |
tree | 8c403ced962975cbedc73b79a018cf8c2170f74a | |
parent | 7135fb0076664cdc13d2af537a2a00b37d61fa54 (diff) |
Show all category history even if category renamed
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Bodies.pm | 3 | ||||
-rw-r--r-- | t/app/controller/admin/bodies.t | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b31e4cf95..6bc23c6a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - Fix multiple disable messages for dropdown answers - Do not trigger duplicate check when checking stoppers - Do not strip spaces from middle of Open311 category codes. #3167 + - Show all category history even if category renamed. - Admin improvements: - Display user name/email for contributed as reports. #2990 - Interface for enabling anonymous reports for certain categories. #2989 diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm index 670336c14..f1a6f938b 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm @@ -151,8 +151,7 @@ sub category : Chained('body') : PathPart('') { my $history = $c->model('DB::ContactsHistory')->search( { - body_id => $c->stash->{body_id}, - category => $c->stash->{contact}->category + contact_id => $c->stash->{contact}->id, }, { order_by => ['contacts_history_id'] diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index b63cacd9d..542c3f4c0 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -111,6 +111,7 @@ subtest 'check contact renaming' => sub { $mech->get('/admin/body/' . $body->id . '/test%20category'); is $mech->res->code, 404; $mech->get_ok('/admin/body/' . $body->id . '/testing%20category'); + $mech->content_contains('<td><strong>test2@example.com</strong></td>'); $report->discard_changes; is $report->category, 'testing category'; $mech->submit_form_ok( { with_fields => { category => 'test category' } } ); |