Browse Source

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>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
master
Nick Clemens 1 month ago
committed by Martin Renvoize
parent
commit
2e51b7e5d9
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 4
      koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc

4
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;
});
@ -554,7 +554,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' %]

Loading…
Cancel
Save