[rt-devel] RT::Ticket bug.

Todd Chapman rt at chaka.net
Thu Mar 18 12:51:50 EST 2004


RT::Ticket::_Links builds an RT::Links object or
all tickets that are linked to the current ticket.
It appears that one of the links returned would
be a link back to itself.

  $Tickets->Limit( FIELD => 'EffectiveId',
                   VALUE => $self->EffectiveId );
  while (my $Ticket = $Tickets->Next) {
       $self->{"$field$type"}->Limit( FIELD => $field,
                                      VALUE => $Ticket->URI,
                                      ENTRYAGGREGATOR => 'OR' );
  }


Should there back a check right after the while?

  $Tickets->Limit( FIELD => 'EffectiveId',
                   VALUE => $self->EffectiveId );
  while (my $Ticket = $Tickets->Next) {
       # Don't want to get a link to ourself!
       next if $Ticket->Id == $self->Id;     # check added
       $self->{"$field$type"}->Limit( FIELD => $field,
                                      VALUE => $Ticket->URI,
                                      ENTRYAGGREGATOR => 'OR' );
  }

-Todd




More information about the Rt-devel mailing list