[rt-devel] RT::Ticket bug.

Ruslan U. Zakirov cubic at acronis.ru
Thu Mar 18 14:07:38 EST 2004


He-he (-:

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.
> 
>   $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?
We have to find Ticket's Links and why we should exclude its id from list?
> 
>   $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