Bug 41675: Fix Quick add patron username being overwritten

Test plan:
1. In system preferences, set PatronQuickAddFields to include userid
   (Username).
2. Go to Patrons and choose Quick add new patron.
3. Fill at least Surname, Card number, and Username
   (use a value clearly different from a surname-based username).
4. Save the patron.
5. Observe on the patron details page that Username is auto-generated
   (not the value entered in quick add).
6. Apply this patch.
7. Repeat steps 2-4 with a new patron.
8. Verify on the patron details page that Username now matches the
   value entered in quick add.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
(cherry picked from commit 8903df398a)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
Slava Shishkin 2026-02-19 18:26:54 +02:00 committed by Baptiste Wojtkowski
parent 33a67c0311
commit 9c5a78286a
No known key found for this signature in database
GPG Key ID: 47A8A13E10BC0D40
1 changed files with 3 additions and 1 deletions

View File

@ -1951,7 +1951,9 @@ legend.collapsed i.fa.fa-caret-down::before {
$(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
return;
}
$(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() );
var source_input = $(this).nextAll(":input[name]").first();
var target_input = $(toggle_to+"[for='"+input_label+"']").nextAll(":input[name]").first();
target_input.val( source_input.val() );
});
$(".toggler").toggle();