[rt-devel] RT::Ticket bug.

Jesse Vincent jesse at bestpractical.com
Thu Mar 18 14:06:54 EST 2004


On Mar 18, 2004, at 12:51 PM, Todd Chapman wrote:

> 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.

When would this happen in practice?



>   $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
>
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/mailman/listinfo/rt-devel
>




More information about the Rt-devel mailing list