Bug 39473: Use exact search for column filtering with dropdown

We need to use an exact search when using the id of an option.

Test plan:
0. If not using default KTD data, create an item type with the following settings:
   Item type: BK
   Description: Books
   leave all other values on their defaults

1. Create a new item type with the following settings:
   Item type: BKA
   Description: Other type of book
   leave all other values on their defaults

2. Add or edit items on a bib record so that the record has at least one item of type "Books" and at least one item of type "Another type of book"

3. Go to Normal View for that bib record

4. Click "Show filters" above the item holdings table

5. In the Item type column, filter by "Books"
Only "Books" items show in the table

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ec2fbc0d81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2025-04-22 14:41:24 +02:00 committed by Fridolin Somers
parent 5ab075a7ab
commit 4dbb5cdf67
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 1 additions and 1 deletions

View File

@ -848,7 +848,7 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) {
filters_options[i] = filters_options[i](table_dt)
}
$(filters_options[i]).each(function(){
let o = $('<option value="%s">%s</option>'.format(this._id, this._str));
let o = $('<option value="^%s$">%s</option>'.format(this._id, this._str));
// Compare with lc, or selfreg won't match ^SELFREG$ for instance, see bug 32517
// This is only for category, we might want to apply it only in this case.
existing_search = existing_search.toLowerCase()