[Rt-commit] rt branch, 4.2/sanity-check-lifecycles, created. rt-4.2.9-41-g480fef8

? sunnavy sunnavy at bestpractical.com
Tue Jan 6 07:27:24 EST 2015


The branch, 4.2/sanity-check-lifecycles has been created
        at  480fef8315442292a0a5262e5e41e7b58b5897ea (commit)

- Log -----------------------------------------------------------------
commit 480fef8315442292a0a5262e5e41e7b58b5897ea
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Dec 3 23:04:54 2014 +0800

    warn if queues' lifecycles are missing in config
    
    this warning fires at init stage so admins could find/fix the problem earlier
    
    Fixes: I#28352

diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index e7b5e81..7ac0142 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -627,6 +627,12 @@ sub FillCache {
 
     my $map = RT->Config->Get('Lifecycles') or return;
 
+    for my $name ( RT::Queues->new( RT->SystemUser )->DistinctFieldValues( 'Lifecycle' ) ) {
+        unless ( $map->{$name} ) {
+            warn "Lifecycle $name is missing in %Lifecycles config";
+        }
+    }
+
     %LIFECYCLES_CACHE = %LIFECYCLES = %$map;
     $_ = { %$_ } foreach values %LIFECYCLES_CACHE;
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list