[rt-users] RT::Links strange behaviour

BJ Blanchard blabj at dainty.ca
Wed Jul 8 10:09:10 EDT 2009


I am using RT::Links to iterate over a tickets links in two places.. one
in Ticket_Local.pm and one in a dhandler.  It works fine within
Ticket_Local.pm but not from within the dhandler.

In Ticket_Local.pm, I'm using:

sub FindLinks {
    my $self = shift;
    my $links = new RT::Links($self->CurrentUser);
    $links = $self->Links('Base');
    my $link=$links->Next();
  
    if (defined $link) {
  $RT::Logger->info("found a link from Ticket_Local");
    }
   return 1;
};

In a dhandler I'm using:

    my $ticket = RT::Ticket->new($session{'CurrentUser'} );
    $ticket->Load( $myticketid );
    unless ( $ticket->id ) {
        $RT::Logger->error("Couldn't load ticket #$myticketid");
        return $m->abort( 404 );
    }
    $ticket->FindLinks();
    my $links = new RT::Links($session{'CurrentUser'} );
    $links = $ticket->Links('Base');
    my $link = $links->Next();

    if (defined $link) {
    $RT::Logger->info("found a link from dhandler");
    }


I only get "found a link from Ticket_Local" in logs.

Anyone know why?

NOTE:  I know the example doesn't make sense - but its concise. :)

Thanks,

-Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090708/f4cad258/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stock_smiley-1.png
Type: image/png
Size: 873 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090708/f4cad258/attachment.png>


More information about the rt-users mailing list