[Rt-commit] rt branch 4.4/queue-cf-default-values-on-perl-5.20 created. rt-4.4.5-101-g9ac5e5bd5e

BPS Git Server git at git.bestpractical.com
Tue May 3 14:33:34 UTC 2022


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 "rt".

The branch, 4.4/queue-cf-default-values-on-perl-5.20 has been created
        at  9ac5e5bd5e471c8a8545016589b29a893bbe0169 (commit)

- Log -----------------------------------------------------------------
commit 9ac5e5bd5e471c8a8545016589b29a893bbe0169
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 3 19:06:41 2022 +0800

    Refactor custom field loop code to make it happy on perl prior to 5.22
    
    "scalar" doesn't propagate lvalue context before 5.22, if $cfs is undef,
    then "keys %$cfs" will auto-vivify $cfs and error out:
    
        Modification of a read-only value attempted
    
    This commit fixes the above issue and also tweaks code to not run
    _ParseObjectCustomFieldArgs twice.
    
    See also perl5220delta.

diff --git a/share/html/Admin/Queues/DefaultValues.html b/share/html/Admin/Queues/DefaultValues.html
index 8ab8b6041d..25c7973fad 100644
--- a/share/html/Admin/Queues/DefaultValues.html
+++ b/share/html/Admin/Queues/DefaultValues.html
@@ -159,11 +159,8 @@ elsif ( $ARGS{Update} ) {
         );
         push @results, $msg;
     }
-    for my $cfs (
-        scalar _ParseObjectCustomFieldArgs( \%ARGS )->{'RT::Ticket'}{0},
-        scalar _ParseObjectCustomFieldArgs( \%ARGS )->{'RT::Transaction'}{0}
-        )
-    {
+    my $cf_args = _ParseObjectCustomFieldArgs( \%ARGS );
+    for my $cfs ( map { $cf_args->{$_}{0} || () } qw/RT::Ticket RT::Transaction/ ) {
         for my $cf_id ( keys %$cfs ) {
             # In the case of inconsistent CFV submission,
             # we'll get the 1st grouping in the hash, alphabetically

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list