[Rt-commit] rtir branch 5.0/work-with-timetracking updated. 5.0.1-24-g73cbd84f

BPS Git Server git at git.bestpractical.com
Fri Oct 29 21:54:41 UTC 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtir".

The branch, 5.0/work-with-timetracking has been updated
       via  73cbd84fb1941639b6b2cbdad8eb797901710064 (commit)
      from  b5360eed7d9f29781fe603311b818bce20403883 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 73cbd84fb1941639b6b2cbdad8eb797901710064
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Oct 30 05:26:07 2021 +0800

    Pass a shallow copy of %ARGS to ProcessUpdateMessage to fix TimeWorked
    
    To reproduce the issue, try replying to an incident with multiple
    incident reports: fill "Worked"(e.g. 10 minutes), leave message empty,
    then submit, all tickets involved on the page will have the same
    "TimeWorked" value(even if they had different values before), while the
    correct behavior shall be adding 10 minutes for each ticket.
    
    This is because ProcessUpdateMessage modifies passed in %ARGS:
    
        if (    not @attachments
            and not $args{ARGSRef}->{'AttachTickets'}
            and not length $args{ARGSRef}->{'UpdateContent'} )
        {
            if ( $args{ARGSRef}->{'UpdateTimeWorked'} ) {
                $args{ARGSRef}->{TimeWorked} = $args{TicketObj}->TimeWorked + delete $args{ARGSRef}->{'UpdateTimeWorked'};
            }
        }

diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index c2247aae..3cdbb9b9 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -133,7 +133,7 @@ if ( $ARGS{'BulkAbandon'} ) {
             );
             while ( my $child = $children->Next ) {
                 push @tempresults, ProcessUpdateMessage(
-                    TicketObj => $child, ARGSRef => \%ARGS, KeepAttachments => 1
+                    TicketObj => $child, ARGSRef => { %ARGS }, KeepAttachments => 1
                 );
             }
         }
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index fe1288cc..7d3a6d91 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -198,7 +198,7 @@ if ( $SubmitTicket && !$checks_failure ) {
         my $id = $Ticket->id;
 
         push @results, map { loc("Ticket [_1]: [_2]", $id, $_) }
-            ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS, KeepAttachments => 1 );
+            ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => { %ARGS }, KeepAttachments => 1 );
 
         my %additional;
         if ( $Status ) {

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

Summary of changes:
 html/RTIR/Incident/BulkAbandon.html | 2 +-
 html/RTIR/Incident/Reply/index.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
rtir


More information about the rt-commit mailing list