[Rt-commit] r8314 - in rtir/branches/2.3-EXPERIMENTAL: .
thayes at bestpractical.com
thayes at bestpractical.com
Mon Jul 30 13:07:41 EDT 2007
Author: thayes
Date: Mon Jul 30 13:07:40 2007
New Revision: 8314
Modified:
rtir/branches/2.3-EXPERIMENTAL/ (props changed)
rtir/branches/2.3-EXPERIMENTAL/lib/RT/Action/RTIR_SetState.pm
Log:
r8471 at toth: toth | 2007-07-30 13:05:58 -0400
* added check to make sure CustomField in transaction is not State field (causes infinite loop)
Modified: rtir/branches/2.3-EXPERIMENTAL/lib/RT/Action/RTIR_SetState.pm
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/lib/RT/Action/RTIR_SetState.pm (original)
+++ rtir/branches/2.3-EXPERIMENTAL/lib/RT/Action/RTIR_SetState.pm Mon Jul 30 13:07:40 2007
@@ -21,18 +21,22 @@
my $self = shift;
my $t = $self->TicketObj;
-
my $cf = RT::CustomField->new( $self->TransactionObj->CurrentUser );
$cf->LoadByNameAndQueue( Queue => $t->QueueObj->Id, Name => '_RTIR_State' );
unless ( $cf->Id ) {
$RT::Logger->warning("Couldn't load '_RTIR_State' CF for queue ". $t->QueueObj->Name );
return 1;
}
+
+ if ($self->TransactionObj->Type eq 'CustomField' and $self->TransactionObj->Field == $cf->id) {
+ return 1;
+ }
my $state = $self->GetState;
return 1 unless $state;
my ($res, $msg) = $t->AddCustomFieldValue(Field => $cf->id, Value => $state);
+
$RT::Logger->warning("Couldn't add custom field value: $msg") unless $res;
return 1;
}
More information about the Rt-commit
mailing list