[Bps-public-commit] RT-Extension-MandatoryOnTransition branch, accept-owner, updated. 0.16-2-gcbb7016

Gergely Nagy algernon at bestpractical.com
Fri Oct 26 01:29:41 EDT 2018


The branch, accept-owner has been updated
       via  cbb7016745930040e1a19ce3bf2725bdf7032f0b (commit)
      from  47fcbf91da67ede9d9d9806ea06c5eac13d9f6bb (commit)

Summary of changes:
 lib/RT/Extension/MandatoryOnTransition.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit cbb7016745930040e1a19ce3bf2725bdf7032f0b
Author: Gergely Nagy <algernon at bestpractical.com>
Date:   Fri Oct 26 07:25:27 2018 +0200

    Check the Owner field before checking $ARGSRef->{$arg}
    
    When updating a ticket, and setting the owner explicitly to Nobody,
    $ARGSRef->{$arg} will be defined, but empty by the looks of it, thus
    CheckMandatoryFields() would go to the next field before doing the Owner check.
    For this reason, check the Owner first.

diff --git a/lib/RT/Extension/MandatoryOnTransition.pm b/lib/RT/Extension/MandatoryOnTransition.pm
index b15c762..4a8f805 100644
--- a/lib/RT/Extension/MandatoryOnTransition.pm
+++ b/lib/RT/Extension/MandatoryOnTransition.pm
@@ -451,13 +451,13 @@ sub CheckMandatoryFields {
             ? $CORE_FOR_UPDATE_COPY{$field}
             : $CORE_FOR_CREATE{$field};
         next unless $arg;
-        next if defined $ARGSRef->{$arg} and length $ARGSRef->{$arg};
         if ($field eq 'Owner' and $args{'Ticket'}->$field() == $RT::Nobody->id) {
             push @errors,
                 $CurrentUser->loc("[_1] is required when changing [_2] to [_3]",
                                   $field, $CurrentUser->loc($transition),  $CurrentUser->loc($field_label{$transition}));
             next;
         }
+        next if defined $ARGSRef->{$arg} and length $ARGSRef->{$arg};
 
         # Do we have a value currently?
         # In Create the ticket hasn't been created yet.

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


More information about the Bps-public-commit mailing list