X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FCondition%2FOwnerChange.pm;h=4007a9ab80e52b3237d9e0db128205d00f32c884;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=d981530efc59fc9b69cd30caa59db198ea1047f9;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/rt/lib/RT/Condition/OwnerChange.pm b/rt/lib/RT/Condition/OwnerChange.pm index d981530ef..4007a9ab8 100644 --- a/rt/lib/RT/Condition/OwnerChange.pm +++ b/rt/lib/RT/Condition/OwnerChange.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -49,6 +49,7 @@ package RT::Condition::OwnerChange; use base 'RT::Condition'; use strict; +use warnings; =head2 IsApplicable @@ -61,18 +62,19 @@ If we're changing the owner return true, otherwise return false sub IsApplicable { my $self = shift; - if ( ( $self->TransactionObj->Field || '' ) eq 'Owner' ) { - return(1); - } - else { - return(undef); - } + return unless ( $self->TransactionObj->Field || '' ) eq 'Owner'; + + # For tickets, there is both a Set txn (for the column) and a + # SetWatcher txn (for the group); we fire on the former for + # historical consistency. Non-ticket objects will not have a + # denormalized Owner column, and thus need fire on the SetWatcher. + return if $self->TransactionObj->Type eq "SetWatcher" + and $self->TransactionObj->ObjectType eq "RT::Ticket"; + + return(1); } -eval "require RT::Condition::OwnerChange_Vendor"; -die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/OwnerChange_Vendor.pm}); -eval "require RT::Condition::OwnerChange_Local"; -die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/OwnerChange_Local.pm}); +RT::Base->_ImportOverlays(); 1;