aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-06 17:00:25 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-07-07 14:59:57 +0100
commit56ff18a3f9495c41d84cc7c68aea0bc81313b392 (patch)
treef7c9cd6c6361968381af7c0677c7971414023062
parentee42ae7994e80e716a694dedcc30ad85333ef98a (diff)
Handle arrayrefs in moderation extra diff display.
-rw-r--r--perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
index d2059ab9d..0ff61d64f 100644
--- a/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
+++ b/perllib/FixMyStreet/DB/Result/ModerationOriginalData.pm
@@ -166,6 +166,8 @@ sub compare_extra {
my @all_keys = grep { $_ ne 'sent_to' } sort keys %$both;
my @s;
foreach (@all_keys) {
+ $old->{$_} = join(', ', @{$old->{$_}}) if ref $old->{$_} eq 'ARRAY';
+ $new->{$_} = join(', ', @{$new->{$_}}) if ref $new->{$_} eq 'ARRAY';
if ($old->{$_} && $new->{$_}) {
push @s, string_diff("$_ = $old->{$_}", "$_ = $new->{$_}");
} elsif ($new->{$_}) {
@@ -174,7 +176,7 @@ sub compare_extra {
push @s, string_diff("$_ = $old->{$_}", "");
}
}
- return join ', ', grep { $_ } @s;
+ return join '; ', grep { $_ } @s;
}
sub extra_diff {