[Rt-commit] rt branch 5.0.2-releng updated. rt-5.0.2beta1-9-g4c78fb4cb5

BPS Git Server git at git.bestpractical.com
Wed Sep 1 20:54:29 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 "rt".

The branch, 5.0.2-releng has been updated
       via  4c78fb4cb58aece6e9903b903cbda016b8971b20 (commit)
       via  a2657246658cc9ed39c3b52609b3b30a6c6f6a34 (commit)
      from  617a2b73399ecf1386d2fd2421edfbd54f25612e (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 4c78fb4cb58aece6e9903b903cbda016b8971b20
Merge: 617a2b7339 a265724665
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 2 04:38:45 2021 +0800

    Merge branch '5.0/bulk-update-default-cf-value' into 5.0.2-releng


commit a2657246658cc9ed39c3b52609b3b30a6c6f6a34
Author: Steven Burr <steve at bestpractical.com>
Date:   Thu Aug 26 09:45:44 2021 -0400

    Always default to no value for select type CFs on bulk update
    
    A select type ticket custom field set as Mandatory and with a
    default value set via the queue Default Values configuration
    renders without the "(no value)" option. On the Bulk Update
    page, it incorrectly defaults to selecting the first value in
    the dropdown rather than the value defined in the queue default
    configuration. This is because EditCustomFieldSelect expects any
    CF defaults to be set and passed in, and Bulk Update does not
    perform the lookup to check for CF default values.
    
    If a user goes to Bulk Update to update a different field, this
    results in an unexpected update of the custom field when the page
    is submitted, setting it to the first value in the list for all the
    tickets bulk updated.
    
    Rather than modify Bulk Update to load the correct default value,
    manually pass ShowEmptyOption to default the dropdown to "no value",
    avoiding the unexpected update of the custom field completely. Users
    can still select a value if they intend to bulk update that field.
    
    The @del version of the dropdown doesn't have this issue because
    it is rendered as a multiple select and as such always defaults
    to having no value selected.

diff --git a/share/html/Elements/BulkCustomFields b/share/html/Elements/BulkCustomFields
index 0a355d2ff3..efea2c0064 100644
--- a/share/html/Elements/BulkCustomFields
+++ b/share/html/Elements/BulkCustomFields
@@ -71,7 +71,8 @@
 % my $cf_id = $cf->id;
 % my @add = (NamePrefix => 'Bulk-Add-CustomField-', CustomField => $cf, Rows => $rows,
 %   MaxValues => $cf->MaxValues, Multiple => ($cf->MaxValues == 1 ? 0 : 1) , Cols => 25,
-%   Default => $ARGS{"Bulk-Add-CustomField-$cf_id-Values"} || $ARGS{"Bulk-Add-CustomField-$cf_id-Value"}, );
+%   Default => $ARGS{"Bulk-Add-CustomField-$cf_id-Values"} || $ARGS{"Bulk-Add-CustomField-$cf_id-Value"},
+%   ShowEmptyOption => 1 );
 % my @del = (NamePrefix => 'Bulk-Delete-CustomField-', CustomField => $cf,
 %   MaxValues => 0, Rows => $rows, Multiple => 1, Cols => 25,
 %   Default => $ARGS{"Bulk-Delete-CustomField-$cf_id-Values"} || $ARGS{"Bulk-Delete-CustomField-$cf_id-Value"}, );

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

Summary of changes:
 share/html/Elements/BulkCustomFields | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list