From edb9989ca77c529cd8704f058b0ddceb02e0738d Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Mon, 26 Mar 2018 12:33:00 +0200 Subject: [PATCH] Run Batch scrips once when a correspondence is mixed with a CF change On the Web UI, a response or comment on a ticket with a CF change at the same times, makes TransactionBatch scrips run for the message/basic fields transactions and another run for custom fields changes. In Update.html, TicketObj was given to ProcessObjectCustomFieldUpdates as $args{TicketObj} when this method works on $args{Object}. Without Object, the method loads the ticket using the id present in customfields ARGSRef, leading to a different object than the current batch one. --- share/html/Ticket/Display.html | 2 +- share/html/Ticket/ModifyLinks.html | 2 +- share/html/Ticket/ModifyPeople.html | 2 +- share/html/m/ticket/show | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html index 8e02f63d357..f5cc22f1db8 100644 --- a/share/html/Ticket/Display.html +++ b/share/html/Ticket/Display.html @@ -191,7 +191,7 @@ push @Actions, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketLinks( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketDates( ARGSRef => \%ARGS, TicketObj => $TicketObj ); - push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $TicketObj ); + push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, Object => $TicketObj ); push @Actions, ProcessTicketReminders( ARGSRef => \%ARGS, TicketObj => $TicketObj ); }); if ( !$SkipProcessing ) { diff --git a/share/html/Ticket/ModifyLinks.html b/share/html/Ticket/ModifyLinks.html index f67db2c20b9..3a9247fe9b7 100644 --- a/share/html/Ticket/ModifyLinks.html +++ b/share/html/Ticket/ModifyLinks.html @@ -76,7 +76,7 @@ $Ticket->Atomic(sub{ $m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS, Results => \@results ); push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS ); - push @results, ProcessObjectCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS ); + push @results, ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS ); }); MaybeRedirectForResults( diff --git a/share/html/Ticket/ModifyPeople.html b/share/html/Ticket/ModifyPeople.html index c5eafbf6ccd..bc7e965ce2d 100644 --- a/share/html/Ticket/ModifyPeople.html +++ b/share/html/Ticket/ModifyPeople.html @@ -109,7 +109,7 @@ $Ticket->Atomic(sub{ push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); - push @results, ProcessObjectCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS ); + push @results, ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS ); }); } diff --git a/share/html/m/ticket/show b/share/html/m/ticket/show index d7cc6a13c8e..826b9006875 100644 --- a/share/html/m/ticket/show +++ b/share/html/m/ticket/show @@ -106,7 +106,7 @@ if ($ARGS{'id'} eq 'new') { push @Actions, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $Ticket ); push @Actions, ProcessTicketLinks( ARGSRef => \%ARGS, TicketObj => $Ticket ); push @Actions, ProcessTicketDates( ARGSRef => \%ARGS, TicketObj => $Ticket ); - push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $Ticket ); + push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, Object => $Ticket ); push @Actions, ProcessTicketReminders( ARGSRef => \%ARGS, TicketObj => $Ticket ); });