Skip to content

Commit

Permalink
Improve Lifecycle validation messages
Browse files Browse the repository at this point in the history
Users were getting non clear message when trying to update Lifecycles
without required default configuration.
  • Loading branch information
richieri-bps committed Jul 12, 2023
1 parent 64666b7 commit d492bdd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/RT/Lifecycle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,10 @@ sub ValidateLifecycle {
# ->{actions} are handled below
for my $state ( keys %{ $lifecycle->{defaults} || {} } ) {
my $status = $lifecycle->{defaults}{$state};
push @warnings, $current_user->loc( "Nonexistant status [_1] in default states in [_2] lifecycle", lc $status, $name )
unless $lifecycle->{canonical_case}{ lc $status };
push @warnings, $current_user->loc( "[_1] Lifecycle has no default [_2] config", $name, $state )
unless $status;
push @warnings, $current_user->loc( "Nonexistant status [_1] in default [_2] in [_3] lifecycle", lc $status, $state, $name )
if $status && !$lifecycle->{canonical_case}{ lc $status };
}
for my $from ( keys %{ $lifecycle->{transitions} || {} } ) {
push @warnings, $current_user->loc( "Nonexistant status [_1] in transitions in [_2] lifecycle", lc $from, $name )
Expand Down

0 comments on commit d492bdd

Please sign in to comment.