[Bug 39828] New: QuickAdd skips fields from PatronQuickAddFields in some cases
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Bug ID: 39828 Summary: QuickAdd skips fields from PatronQuickAddFields in some cases Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: slavashishkin@gmail.com Reporter: slavashishkin@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When using PatronQuickAddFields to add fields to the Quick Add form, fields that exist in the main form but contain multiple input elements (especially hidden/disabled ones) may be silently skipped during QuickAdd form generation. Example: "userid" field exists in the full patron form (entryform) as:
<li> <label for="userid">Username:</label> <input type="text" id="userid" name="userid" ...> <input type="text" disabled="disabled" style="display:none" ...> </li>
The current JavaScript logic to detect and clone these fields uses:
let orig_input_id = orig_li.children("input,textarea,select").last().attr("id");
In this example, .last() selects the hidden disabled input without an id → orig_input_id becomes undefined → and the field is not cloned into QuickAdd form. Result: userid is missing from Quick Add even though it's included in PatronQuickAddFields. Steps to reproduce: 1. Add userid (or any other field that matches above structure) to PatronQuickAddFields. 2. Open the Add Patron form and use Quick Add. 3. Observe → the field is missing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Slava Shishkin <slavashishkin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 --- Comment #1 from Slava Shishkin <slavashishkin@gmail.com> --- Created attachment 181902 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181902&action=edit Bug 39828: Fix QuickAdd skipping fields Currently, fields like userid are skipped if the last input in the main form is hidden or has no ID. This patch fixes the selection logic to avoid skipping. Steps to reproduce: 1. Add userid (or any other field that matches above structure) to PatronQuickAddFields. 2. Open the Add Patron form and use Quick Add. 3. Observe → the field is missing. 4. Apply the patch. 5. Use Quick Add again and observe that 'Username' field is there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #181902|0 |1 is obsolete| | --- Comment #2 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 181972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181972&action=edit Bug 39828: Fix QuickAdd skipping fields Currently, fields like userid are skipped if the last input in the main form is hidden or has no ID. This patch fixes the selection logic to avoid skipping. Steps to reproduce: 1. Add userid (or any other field that matches above structure) to PatronQuickAddFields. 2. Open the Add Patron form and use Quick Add. 3. Observe → the field is missing. 4. Apply the patch. 5. Use Quick Add again and observe that 'Username' field is there. Signed-off-by: Chloe Zermatten <chloe.zermatten@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chloe.zermatten@openfifth.c | |o.uk Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk --- Comment #3 from Aude Charillon <aude.charillon@openfifth.co.uk> --- We have also noticed this issue. It appeared after upgrading from 23.11 to 24.11.04. (Before upgrading, the username field was appearing in the quick add form according to PatronQuickAddFields). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Laura.escamilla@bywatersolu | |tions.com --- Comment #4 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- I'm not able to recreate this in Main KTD 25.06. Are you still seeing this issue? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39828 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |RESOLVED Resolution|--- |WORKSFORME -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org