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

BPS Git Server git at git.bestpractical.com
Tue Jan 2 20:55:13 UTC 2024


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  df3737d9e1344a216f3034585a489a7cbbc61dcb (commit)

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

    Exclude radio and checkbox inputs from duplicate check for inline edit
    
    All input elements in a radio button or checkbox 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 and checkbox CFs getting unset when a form
    field in another portet was updated. Excluding these 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..02bca8faed 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 and checkbox because the name of all inputs are the same
+                 * so checked values don't get properly submitted. This results in these CFs getting
+                 * unset when a field in another portlet is updated because the current value isn't
+                 * submitted. */
+                if (field.attr('type') != 'radio' && field.attr('type') != 'checkbox' && 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