rt 4.2.13 ticket#13852
[freeside.git] / rt / lib / RT / Condition / StatusChange.pm
index 10d882e..97153c6 100644 (file)
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -49,6 +49,7 @@
 package RT::Condition::StatusChange;
 use base 'RT::Condition';
 use strict;
+use warnings;
 
 =head2 DESCRIPTION
 
@@ -113,11 +114,11 @@ sub IsApplicable {
     }
     else {
         $RT::Logger->error("Argument '$argument' is incorrect.")
-            unless RT::Lifecycle->Load('')->IsValid( $argument );
+            unless RT::Lifecycle->Load(Type => 'ticket')->IsValid( $argument );
         return 0;
     }
 
-    my $lifecycle = $self->TicketObj->QueueObj->Lifecycle;
+    my $lifecycle = $self->TicketObj->LifecycleObj;
     if ( $new_must_be ) {
         return 0 unless grep lc($new) eq lc($_),
             map {m/^(initial|active|inactive)$/i? $lifecycle->Valid(lc $_): $_ }