[Rt-commit] r17936 - in rtir/2.4/trunk: html/Callbacks/RTIR/Ticket/Elements/ShowHistory

ruz at bestpractical.com ruz at bestpractical.com
Tue Jan 27 07:06:33 EST 2009


Author: ruz
Date: Tue Jan 27 07:06:28 2009
New Revision: 17936

Modified:
   rtir/2.4/trunk/CHANGES
   rtir/2.4/trunk/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction

Log:
* don't set $$skip to zero in SkipTransaction callback as it may
  conflict with other users of this callback. Just use return and
  as well check asap if the txn is already skipped.


Modified: rtir/2.4/trunk/CHANGES
==============================================================================
--- rtir/2.4/trunk/CHANGES	(original)
+++ rtir/2.4/trunk/CHANGES	Tue Jan 27 07:06:28 2009
@@ -1,3 +1,13 @@
+CHANGES IN 2.4.2
+----------------
+
+BUGS
+====
+
+* don't set $$skip to zero in SkipTransaction callback as it may
+  conflict with other users of this callback. Just use return and
+  as well check asap if the txn is already skipped.
+
 CHANGES IN 2.4.1
 ----------------
 

Modified: rtir/2.4/trunk/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction
==============================================================================
--- rtir/2.4/trunk/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction	(original)
+++ rtir/2.4/trunk/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction	Tue Jan 27 07:06:28 2009
@@ -1,30 +1,32 @@
 <%INIT>
+# return if already skipped
+return if $$skip;
 
 # Set $skip to 1 if transaction matches criteria
 # $skip is passed by reference
 
+my $type = $Transaction->Type;
+
 # skip _RTIR_IP changes done by system user(scrips)
-if ( $Transaction->Creator == $RT::SystemUser->id && $Transaction->Type eq 'CustomField' ) {
-    my $cf = RT::IR::GetCustomField('_RTIR_IP') or return $$skip = 0;
-    return $$skip = 0 unless $cf->id == $Transaction->Field;
+if ( $Transaction->Creator == $RT::SystemUser->id && $type eq 'CustomField' ) {
+    my $cf = RT::IR::GetCustomField('_RTIR_IP')
+        or return;
+    return unless $cf->id == $Transaction->Field;
     return $$skip = 1;
 }
 
 # get out of here asap
-unless ( $Transaction->Type =~ /^(?:Status|Set)$/ && $Transaction->Field  eq 'Status') {
-    return $$skip = 0;
+unless ( $type =~ /^(?:Status|Set)$/ && $Transaction->Field  eq 'Status') {
+    return;
 }
 
 # check only ticket's transactions
 my $obj = $Transaction->Object;
-return $$skip = 0 unless $obj && $obj->isa( 'RT::Ticket' );
+return unless $obj && $obj->isa( 'RT::Ticket' );
 
 # only check if it's an RTIR queue
 my $Queue = $obj->QueueObj->Name;
 return $$skip = 1 if $Queue =~ /^(?:Incidents|Incident Reports|Investigations|Blocks)$/i;
-
-return $$skip = 0;
-
 </%INIT>
 
 <%ARGS>


More information about the Rt-commit mailing list