[Rt-commit] r2095 - in rt/branches/PLATANO-EXPERIMENTAL: . lib/RT
jesse at bestpractical.com
jesse at bestpractical.com
Fri Jan 14 03:52:53 EST 2005
Author: jesse
Date: Fri Jan 14 03:52:52 2005
New Revision: 2095
Modified:
rt/branches/PLATANO-EXPERIMENTAL/ (props changed)
rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
Log:
r2534 at hualien (orig r2040): jesse | 2005-01-04T05:18:06.259505Z
r2530 at hualien: jesse | 2005-01-04T05:15:35.757280Z
a couple fixes for better handling ticket links on merge
Modified: rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm (original)
+++ rt/branches/PLATANO-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm Fri Jan 14 03:52:52 2005
@@ -2712,11 +2712,17 @@
my $old_links_to = RT::Links->new($self->CurrentUser);
$old_links_to->Limit(FIELD => 'Target', VALUE => $self->URI);
+ my %old_seen;
while (my $link = $old_links_to->Next) {
- if ($link->Base eq $MergeInto->URI) {
+ if (exists $old_seen{$link->Base."-".$link->Type}) {
+ $link->Delete;
+ }
+ elsif ($link->Base eq $MergeInto->URI) {
$link->Delete;
} else {
$link->SetTarget($MergeInto->URI);
+ $link->SetLocalTarget($MergeInto->id);
+ $old_seen{$link->Base."-".$link->Type} =1;
}
}
@@ -2725,10 +2731,15 @@
$old_links_from->Limit(FIELD => 'Base', VALUE => $self->URI);
while (my $link = $old_links_from->Next) {
+ if (exists $old_seen{$link->Type."-".$link->Target}) {
+ $link->Delete;
+ }
if ($link->Target eq $MergeInto->URI) {
$link->Delete;
} else {
$link->SetBase($MergeInto->URI);
+ $link->SetLocalBase($MergeInto->id);
+ $old_seen{$link->Type."-".$link->Target} =1;
}
}
More information about the Rt-commit
mailing list