[Koha-bugs] [Bug 31565] New: Patron search filter by category code with special character returns no results

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 14 15:53:54 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31565

            Bug ID: 31565
           Summary: Patron search filter by category code with special
                    character returns no results
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Staff Client
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: lari.taskula at hypernova.fi
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list