[Rt-commit] r18590 - rt/3.999/branches/lorzy/lib/RT/Model

clkao at bestpractical.com clkao at bestpractical.com
Wed Feb 25 12:02:35 EST 2009


Author: clkao
Date: Wed Feb 25 12:02:35 2009
New Revision: 18590

Modified:
   rt/3.999/branches/lorzy/lib/RT/Model/Ticket.pm
   rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm

Log:
Escalate current_user for ticket correctly before entering rules.

Modified: rt/3.999/branches/lorzy/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Model/Ticket.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Model/Ticket.pm	Wed Feb 25 12:02:35 2009
@@ -2536,10 +2536,13 @@
     my $batch = $self->transaction_batch or return;
     return unless @$batch;
 
+    my $ticket = RT::Model::Ticket->new( current_user => RT::CurrentUser->superuser );
+    $ticket->load( $self->id );
+
     # Entry point of the rule system
     my $rules = RT::Ruleset->find_all_rules(
         stage           => 'transaction_batch',
-        ticket_obj      => $self,
+        ticket_obj      => $ticket,
         transaction_obj => $batch->[0],
         type            => join( ',', map $_->type, grep defined, @{$batch} )
     );

Modified: rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm	Wed Feb 25 12:02:35 2009
@@ -375,7 +375,7 @@
     Jifty->log->debug( 'About to think about scrips for transaction #' . $self->id );
     if ( $activate_scrips and $args{'object_type'} eq 'RT::Model::Ticket' ) {
         # Entry point of the rule system
-        my $ticket = RT::Model::Ticket->new;
+        my $ticket = RT::Model::Ticket->new( current_user => RT::CurrentUser->superuser );
         $ticket->load( $args{'object_id'} );
         my $rules = RT::Ruleset->find_all_rules(
             stage          => 'transaction_create',


More information about the Rt-commit mailing list