aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-01-17 14:02:46 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-01-17 14:02:46 +0000
commite25e1a929c0eff5a3a50da5185c9dbe13ad53028 (patch)
tree9e43be62c5517fde8a720d0071dee9a814425ead
parent6e2c77b2e1f3f693d806a9c0237403e3273378af (diff)
Don’t show creation diffs with old history entries.
Old moderation history entries will have blank category/co-ords, and we don’t want to say they’ve changed on appearance.
-rw-r--r--perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
index 1e61b946a..d947c4f6b 100644
--- a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
+++ b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
@@ -120,6 +120,7 @@ sub compare_anonymous {
sub compare_coords {
my ($self, $other) = @_;
+ return '' unless $self->latitude && $self->longitude;
my $old = join ',', $self->latitude, $self->longitude;
my $new = join ',', $other->latitude, $other->longitude;
string_diff($old, $new, single => 1);
@@ -186,6 +187,7 @@ sub string_diff {
$new = FixMyStreet::Template::html_filter($new);
if ($options{single}) {
+ return unless $old;
$old = [ $old ];
$new = [ $new ];
}