Bugzilla – Attachment 187739 Details for
Bug 40995
Patron search autocomplete adds extraneous spacing and punctuation when patron lacks surname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40995: Use patron_to_html in patron autocomplete
Bug-40995-Use-patrontohtml-in-patron-autocomplete.patch (text/plain), 2.27 KB, created by
Jonathan Druart
on 2025-10-10 14:15:46 UTC
(
hide
)
Description:
Bug 40995: Use patron_to_html in patron autocomplete
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-10 14:15:46 UTC
Size:
2.27 KB
patch
obsolete
>From dd311a32aa8a2068b9bea090c0495d02e6d44a47 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 10 Oct 2025 16:12:24 +0200 >Subject: [PATCH] Bug 40995: Use patron_to_html in patron autocomplete > >So we deal with punctuation like in other places. > >If your autocomplete results include a patron without a surname, >Koha still puts a comma and space between the first name and the nonexistent surname, like ", Henry." >--- > .../intranet-tmpl/prog/js/staff-global.js | 20 +------------------ > 1 file changed, 1 insertion(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index b9c9e937240..34b41c62d6f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -790,11 +790,6 @@ function patron_autocomplete(node, options) { > item.link = null; > } > >- var cardnumber = ""; >- if (item.cardnumber != "") { >- // Display card number in parentheses if it exists >- cardnumber = " (" + item.cardnumber + ") "; >- } > if (item.library_id == loggedInLibrary) { > loggedInClass = "ac-currentlibrary"; > } else { >@@ -806,20 +801,7 @@ function patron_autocomplete(node, options) { > .append( > "" + > (item.link ? '<a href="' + item.link + '">' : "<a>") + >- (item.surname ? item.surname.escapeHtml() : "") + >- ", " + >- (item.preferred_name >- ? item.preferred_name.escapeHtml() >- : item.firstname >- ? item.firstname.escapeHtml() >- : "") + >- " " + >- (item.middle_name ? item.middle_name.escapeHtml() : "") + >- " " + >- (item.other_name >- ? "(" + item.other_name.escapeHtml() + ")" >- : "") + >- cardnumber.escapeHtml() + >+ $patron_to_html(item, { display_cardnumber: true }) + > " " + > (item.date_of_birth > ? $date(item.date_of_birth) + >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40995
:
187739
|
187745