[Bps-public-commit] RT-Extension-MandatoryOnTransition branch, check-for-to-field, created. 0.18-1-g77ce9e4

Craig Kaiser craig at bestpractical.com
Mon Jul 1 17:21:47 EDT 2019


The branch, check-for-to-field has been created
        at  77ce9e415cf49fc225760d2a26596269d5c76310 (commit)

- Log -----------------------------------------------------------------
commit 77ce9e415cf49fc225760d2a26596269d5c76310
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Mon Jul 1 17:20:41 2019 -0400

    Check if we have a 'To' field before checking mandatory conditions
    
    If there is no 'To' field then the error will default to complaining that
    some field(s) are mandatory on queue change, even when the change being
    made is not a queue change.

diff --git a/lib/RT/Extension/MandatoryOnTransition.pm b/lib/RT/Extension/MandatoryOnTransition.pm
index 97bf52c..a5001af 100644
--- a/lib/RT/Extension/MandatoryOnTransition.pm
+++ b/lib/RT/Extension/MandatoryOnTransition.pm
@@ -503,6 +503,7 @@ sub CheckMandatoryFields {
     return \@errors unless @$core or @$cfs or @$roles;
 
     my $transition =  ($args{'From'} ||'') ne ($args{'To'} || '') ? 'Status' : 'Queue';
+    return \@errors unless $args{'To'} && $args{'From'} ne $args{'To'};
 
     # If we were called from Modify.html (Basics) or ModifyAll.html
     # (Jumbo), where the SubmitTicket button goes by 'Save Changes',

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


More information about the Bps-public-commit mailing list