[Rt-commit] rt branch 5.0/inline-edit-always-cfs created. rt-5.0.5-99-g278db8dfac

BPS Git Server git at git.bestpractical.com
Fri Dec 22 21:52:00 UTC 2023


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/inline-edit-always-cfs has been created
        at  278db8dfacfa467635a63d0b3b6ff85f6539fbbb (commit)

- Log -----------------------------------------------------------------
commit 278db8dfacfa467635a63d0b3b6ff85f6539fbbb
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Dec 22 16:47:26 2023 -0500

    Exclude radio inputs from duplicate name check for inline edit
    
    All input elements in a radio button list have the same name,
    so the rule excluding inputs with a duplicate name was also
    missing any "checked" inputs. Using inline edit mode "always",
    this resulted in radio button CFs getting unset when a form field
    in another portet was updated. Excluding radios from the name
    duplicate check allows the form values to be cloned and submitted
    correctly.

diff --git a/share/static/js/util.js b/share/static/js/util.js
index d349bd6dcc..2bf1ff815f 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -1421,7 +1421,11 @@ jQuery(function () {
                 }
 
                 /* skip duplicates, such as ticket id */
-                if (currentForm.find('[name="' + field.attr('name') + '"]').length > 0) {
+                /* Specifically exclude radio buttons because the name of all radio inputs are the same
+                 * so checked values don't get properly submitted. This results in radio CFs getting
+                 * updated when a field in another portlet is updated because the current value isn't
+                 * submitted. */
+                if (field.attr('type') != 'radio' && currentForm.find('[name="' + field.attr('name') + '"]').length > 0) {
                     return;
                 }
 

commit 6d480e04baac93d5ca06c28648849093a0ac0910
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Dec 22 16:47:03 2023 -0500

    Remove the duplicate id definition in the input

diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect
index 9921e5e965..a6f23854c2 100644
--- a/share/html/Elements/EditCustomFieldSelect
+++ b/share/html/Elements/EditCustomFieldSelect
@@ -62,7 +62,7 @@
 %   if ( $checktype eq 'radio' ) {
 % if ( $show_empty_option ) {
   <div class="none custom-control custom-radio">
-    <input class="none custom-control-input" id="<% $name %>-none" type="<% $checktype %>" name="<% $name %>" id="<% $name %>-none" value="" <% keys %default ? '' : ' checked="checked"' |n%> />
+    <input class="none custom-control-input" id="<% $name %>-none" type="<% $checktype %>" name="<% $name %>" value="" <% keys %default ? '' : ' checked="checked"' |n%> />
     <label class="custom-control-label" for="<% $name %>-none"><&|/l&>(no value)</&></label>
   </div>
 % }

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list