Skip to content

Commit

Permalink
Exclude radio and checkbox inputs from duplicate check for inline edit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbrandtbuffalo committed Jan 2, 2024
1 parent 6d480e0 commit df3737d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion share/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit df3737d

Please sign in to comment.