Bugzilla – Attachment 144805 Details for
Bug 32517
Patron search dies on case mismatch of patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32517: lowercase category codes to avoid mismatch
Bug-32517-lowercase-category-codes-to-avoid-mismat.patch (text/plain), 1.71 KB, created by
David Nind
on 2022-12-22 21:12:34 UTC
(
hide
)
Description:
Bug 32517: lowercase category codes to avoid mismatch
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-12-22 21:12:34 UTC
Size:
1.71 KB
patch
obsolete
>From 2f405e9bafe25f9a55747c31c3bf23bc2c6fe423 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 22 Dec 2022 15:18:20 +0000 >Subject: [PATCH] Bug 32517: lowercase category codes to avoid mismatch > >To test: >1 - sudo koha-mysql kohadev >2 - UPDATE borrowers SET categorycode = LCASE(categorycode) >3 - Try to search for patrons: > Uncaught TypeError: categories_map[data] is undefined >4 - Apply patch >5 - Search for patrons >6 - Success! > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index de4ba90c0d..6444468707 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -213,7 +213,7 @@ > [% END %] > <script> > let categories = [% To.json(categories) | $raw %].map(e => { >- e['_id'] = e.categorycode; >+ e['_id'] = e.categorycode.toLowerCase(); > e['_str'] = e.description; > return e; > }); >@@ -546,7 +546,7 @@ > "searchable": true, > "orderable": true, > "render": function( data, type, row, meta ) { >- return escape_str(categories_map[data].description); >+ return escape_str(categories_map[data.toLowerCase()].description); > } > } > [% CASE 'dateexpiry' %] >-- >2.30.2
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 32517
:
144795
|
144805
|
145256