summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Migrate/Flyspray.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Migrate/Flyspray.pm b/Bugzilla/Migrate/Flyspray.pm
index 527997361..ebcd9663b 100644
--- a/Bugzilla/Migrate/Flyspray.pm
+++ b/Bugzilla/Migrate/Flyspray.pm
@@ -485,13 +485,15 @@ sub _read_bugs {
$self->translate_value('resolution', $bug->{resolution} // "") eq "DUPLICATE"
and $closure_comment =~ m/FS#(\d+)/)
{
- push @{$self->{dupes}},
+ push @{$self->{dupe_comments}},
{
dupe_of => int($1),
dupe => $row->{task_id},
who => $self->_get_username($history->{user_id}),
bug_when => $self->parse_date($history->{event_date}),
};
+ $self->{dupe_mappings}->{$row->{task_id}}
+ = {dupe_of => int($1), dupe => $row->{task_id},};
}
}
}
@@ -619,11 +621,14 @@ sub after_insert {
my ($self) = @_;
$self->debug("Marking duplicate bugs");
- for my $entry (@{$self->{dupes}}) {
+ for my $entry (values %{$self->{dupe_mappings}}) {
my $dupeOf_bug = Bugzilla::Bug->new($entry->{dupe_of});
$self->{dbh}->do("INSERT INTO duplicates (dupe_of, dupe) VALUES (?, ?)",
undef, $entry->{dupe_of}, $entry->{dupe})
unless defined $dupeOf_bug->{error};
+ }
+ for my $entry (@{$self->{dupe_comments}}) {
+ my $dupeOf_bug = Bugzilla::Bug->new($entry->{dupe_of});
my $dupe_bug = Bugzilla::Bug->new($entry->{dupe});