aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM Somerville <matthew-github@dracos.co.uk>2020-10-09 08:05:44 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-10-09 08:05:44 +0100
commit76c4765536d3edbb2dc79a2a6a81a1698c9f9afa (patch)
tree00b5dc789608b93a3307fea1b7e07b74b6359bf4
parent0ee2ac92c1b9f79204a32bc56807d0f0ae1a7813 (diff)
parent043bce556a17545c2c26386d8368f47ba8f541e6 (diff)
Merge branch '3181-missing-history'
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm3
-rw-r--r--t/app/controller/admin/bodies.t1
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' } } );