diff options
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/AdminLog.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/AdminLog.pm b/perllib/FixMyStreet/DB/Result/AdminLog.pm index 5564d829a..4c89138c9 100644 --- a/perllib/FixMyStreet/DB/Result/AdminLog.pm +++ b/perllib/FixMyStreet/DB/Result/AdminLog.pm @@ -91,6 +91,10 @@ sub link { my $category = $self->object; return "/admin/body/" . $category->body_id . '/' . $category->category; } + if ($type eq 'manifesttheme') { + my $theme = $self->object; + return "/admin/manifesttheme/" . $theme->cobrand; + } return ''; } @@ -114,6 +118,7 @@ sub object_summary { role => 'name', template => 'title', category => 'category', + manifesttheme => 'cobrand', }; my $thing = $type_to_thing->{$self->object_type} || 'id'; @@ -130,6 +135,7 @@ sub object { template => 'ResponseTemplate', category => 'Contact', update => 'Comment', + manifesttheme => 'ManifestTheme', }; $type = $type_to_object->{$type} || ucfirst $type; my $object = $self->result_source->schema->resultset($type)->find($id); diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index bac183271..b217bf96c 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -292,6 +292,7 @@ sub is_latest { { problem_id => $self->problem_id, state => 'confirmed' }, { order_by => [ { -desc => 'confirmed' }, { -desc => 'id' } ] } )->first; + return unless $latest_update; return $latest_update->id == $self->id; } |