[rt-users] Scrip errors

Andrew Xenides andrew at staff.esc.net.au
Fri May 6 03:16:47 EDT 2005


Ok, I think we are getting somewhere, I have an error now :P

[Fri May  6 08:16:48 2005] [debug]: About to commit scrips for transaction
#18830 (/opt/rt3/lib/RT/Transaction_Overlay.pm:167)
[Fri May  6 08:16:48 2005] [error]: Scrip 15 Commit failed: Can't locate
object method "Transaction" via package "RT::Action::UserDefined" at (eval
472) line 2.

Stack:
  [(eval 472):2]
  [/opt/rt3/lib/RT/ScripAction_Overlay.pm:228]
  [/opt/rt3/lib/RT/Scrip_Overlay.pm:506]
  [/opt/rt3/lib/RT/Scrips_Overlay.pm:191]
  [/opt/rt3/lib/RT/Transaction_Overlay.pm:168]
  [/opt/rt3/lib/RT/Record.pm:1373]
  [/opt/rt3/lib/RT/Ticket_Overlay.pm:3439]
  [/opt/rt3/lib/RT/Ticket_Overlay.pm:3176]
  [/opt/rt3/lib/RT/Record.pm:873]
  [/opt/rt3/lib/RT/Interface/Web.pm:934]
  [/opt/rt3/lib/RT/Interface/Web.pm:1048]
  [/opt/rt3/share/html/Ticket/Display.html:141]
  [/opt/rt3/share/html/Ticket/Update.html:211]
  [/opt/rt3/share/html/autohandler:215]
 (/opt/rt3/lib/RT/Action/UserDefined.pm:81)

Scrip is:

my $ticket = $self->TicketObj;
return unless $ticket->Owner == $RT::Nobody->Id;
my $trans = $self->TransactionObj;
return unless $ticket->CurrentUserHasRight("TakeTicket");
return 1;

Clean up code:

my $ticket = $self->TicketObj;
my ($status, $msg) = $ticket->SetOwner( $self->Transaction->Creator );
unless( $status ) {
	$RT::Logger->error( "Couldn't set owner: $msg" );
	return 0;
}
return 1;



Andrew Xenides
Web Developer
EscapeNet 
465 South Road
Keswick SA 5035
T: (08) 8292 5200
F: (08) 8292 5299
E: andrew at staff.esc.net.au
W: http://www.esc.net.au

 

> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com 
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf 
> Of Andrew Xenides
> Sent: Friday, 6 May 2005 4:41 PM
> To: 'Ruslan U. Zakirov'
> Cc: rt-users at lists.bestpractical.com
> Subject: RE: [rt-users] Scrip errors
> 
> > > }
> > > $self->{'newowner'} = $trans->Creator;
> > I don't remeber could you save this or not.
> > IMHO you don't get any advantages from saving and can avoid 
> it to be 
> > [backward|forward]compatible.
> > 
> 
> So your saying I can get rid of this completely?
> 
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> 
> 





More information about the rt-users mailing list