[Bps-public-commit] RT-Extension-MandatoryOnTransition branch, check-for-to-field, repushed
Craig Kaiser
craig at bestpractical.com
Tue Jul 2 13:19:22 EDT 2019
The branch check-for-to-field was deleted and repushed:
was 30ff3b78edc717bd0e64eef0aa1c6f01b5cd5b7c
now af1c47963cb8a833cc0191593f4a49cbff385905
1: 30ff3b7 ! 1: af1c479 Check if we have a 'To' field before checking mandatory conditions
@@ -23,10 +23,29 @@
--- a/lib/RT/Extension/MandatoryOnTransition.pm
+++ b/lib/RT/Extension/MandatoryOnTransition.pm
@@
+ }
+
+ # Some convenience variables set depending on what gets passed
+- my ($CFs, $CurrentUser);
++ my ($CFs, $CurrentUser, $queue_current);
+ if ( $args{'Ticket'} ){
+ $CFs = $args{'Ticket'}->CustomFields;
+ $CurrentUser = $args{'Ticket'}->CurrentUser();
++ $queue_current = $args{'Ticket'}->QueueObj->Name;
+ }
+ elsif ( $args{'Queue'} ){
+ $CFs = $args{'Queue'}->TicketCustomFields;
+ $CurrentUser = $args{'Queue'}->CurrentUser();
++ $queue_current = $args{'Queue'}->Name;
+ }
+ else{
+ $RT::Logger->error("CheckMandatoryFields requires a Ticket object or a Queue object");
+@@
return \@errors unless @$core or @$cfs or @$roles;
my $transition = ($args{'From'} ||'') ne ($args{'To'} || '') ? 'Status' : 'Queue';
-+ return \@errors unless $field_label{'Queue'} || $args{'To'} and defined $args{'From'} ? $args{'From'} ne $args{'To'} : 1;
++ return \@errors unless ( $field_label{'Queue'} && $queue_current ne $field_label{'Queue'} )
++ || $args{'To'} and defined $args{'From'} ? $args{'From'} ne $args{'To'} : 1;
# 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