Bug 18961: Use exact match for select filters on item search
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 10 Oct 2017 15:18:10 +0000 (12:18 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 20 Oct 2017 18:58:21 +0000 (15:58 -0300)
commitf0f3cb32889d6f0d64fb4965e8c00a3a1f31c6c9
tree87b561d7fd1fec7bcf2212518d482a189c76ed7e
parent7ed705ea458d47d199b8f3e20572397d4697516a
Bug 18961: Use exact match for select filters on item search

The SQL operator LIKE is always used for filters when searching for
items.

If the filter is a select, we should search for an exact match.
That way we avoid problematic search like "%NFIC%" and "%FIC%" (one
includes the other one).

Test plan:
- Make sure you have collection codes 'Fiction' and 'Non-fiction'
- Do an item search
- Filter column 'Collection', select 'Fiction'
- Result: Column contains items from Fiction only

Followed test plan, works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
catalogue/itemsearch.pl