[Rt-commit] rt branch 5.0/ignore-disabled-lifecycles-in-mapping-validation created. rt-5.0.3-122-gdb90da00f5

BPS Git Server git at git.bestpractical.com
Thu Sep 22 22:27:23 UTC 2022

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/ignore-disabled-lifecycles-in-mapping-validation has been created
        at  db90da00f5b6ffdde6b452f073522ef7b946d631 (commit)

- Log -----------------------------------------------------------------
commit db90da00f5b6ffdde6b452f073522ef7b946d631
Author: Brian Conry <bconry at bestpractical.com>
Date:   Thu Sep 22 17:09:15 2022 -0500

    Ignore disabled lifecycles when validating mappings
    Previously RT performed validation on all lifecycle maps, including
    those that referred to disabled lifecycles.  This would cause a lot of
    warning log messages if some of those mappings were invalid, even if
    both lifecycles involved in the mapping were disabled.
    Since the mappings of disabled lifecycles aren't used, mappings are now
    skipped if any of the lifecycles involved have been disabled.

diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index 51ac72fc66..00df160b51 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -1084,6 +1084,10 @@ sub ValidateLifecycleMaps {
         push @warnings, $current_user->loc( "Nonexistant lifecycle [_1] in [_2] lifecycle map", $to, $mapname )
             unless $LIFECYCLES_CACHE{$to};
+        # Ignore mappings referring to disabled lifecycles
+        next if $LIFECYCLES_CACHE{$from} && $LIFECYCLES_CACHE{$from}{disabled};
+        next if $LIFECYCLES_CACHE{$to} && $LIFECYCLES_CACHE{$to}{disabled};
         my $map = $LIFECYCLES_CACHE{'__maps__'}{$mapname};
         for my $status ( keys %{$map} ) {
             push @warnings, $current_user->loc( "Nonexistant status [_1] in [_2] in [_3] lifecycle map", lc $status, $from, $mapname )



More information about the rt-commit mailing list