Project

General

Profile

Bug #965

Bug 31565 - Patron search filter by category code with special character returns no results

Added by Lari Taskula 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
14.09.2022
Due date:
% Done:

100%

Estimated time:
Spent time:
Koha Bugzilla Bug#:

Description

To reproduce:
1. Add a new patron category with categorycode 'TEST_CAT'
2. Add a patron to category 'TEST_CAT'
3. Go to Patrons search view
4. Under "Search for patron" filters, filter by category you created at step 1
5. Click Search
6. Observe no results

Something to start from:
1. Go to http://yourinstance/api/v1/patrons?_page=1&_per_page=20&q=[{"me.category_id":"TEST\\_CAT"}]&_match=contains&_order_by=+me.surname,+me.firstname,+me.middle_name,+me.othernames,+me.street_number,+me.address,+me.address2,+me.city,+me.state,+me.postal_code,+me.country
2. Observe no results
3. Go to http://yourinstance/api/v1/patrons?_page=1&_per_page=20&q=[{"me.category_id":"TEST_CAT"}]&_match=contains&_order_by=+me.surname,+me.firstname,+me.middle_name,+me.othernames,+me.street_number,+me.address,+me.address2,+me.city,+me.state,+me.postal_code,+me.country

(difference is that we've removed escaping characters \\ from q=[{"me.category_id":"TEST\\_CAT"}] to q=[{"me.category_id":"TEST_CAT"}]

4. Observe 1 result (the patron you added at step 2)

So it has something to do with escape not functioning as expected. If you try q=[{"me.category_id":"TES__CAT"}] or q=[{"me.category_id":"TEST%CAT"}] there are again no results so it also seems like these special characters are not being passed to the database query.

Related Bug 30393

History

#1

Updated by Lari Taskula 2 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF