Bugzilla – Attachment 187745 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.33 KB, created by
Andrew Fuerste-Henry
on 2025-10-10 15:07:50 UTC
(
hide
)
Description:
Bug 40995: Use patron_to_html in patron autocomplete
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-10-10 15:07:50 UTC
Size:
2.33 KB
patch
obsolete
>From d7b70d2a40cb4c2591fc06ca0bdc01ee152162a7 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." > >Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> >--- > .../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 ed6f0b35f7b..36cda8e7673 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -765,11 +765,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 { >@@ -781,20 +776,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.39.5
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