]> git.koha-community.org Git - koha.git/commit
Bug 31013: Quote branchcodes in Elasticsearch limits
authorNick Clemens <nick@bywatersolutions.com>
Wed, 22 Jun 2022 13:19:03 +0000 (13:19 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 23 Jun 2022 14:27:03 +0000 (11:27 -0300)
commita4c5bd58361900983f870f1c0e7f497ae3618c85
tree1068e52d4c29400bc4f8687fb8a79f2869ac5d30
parent7a7bee59021728a30c631e2ee51f9b7778217a9f
Bug 31013: Quote branchcodes in Elasticsearch limits

This patch adds quoting when handling branchcodes in searching in order
to prevent errors when branchcodes are reserved words in ES

To test:
0 - Be using Elasticsearch with Koha
1 - Add a new branch code:OR name:Orly
2 - Add an item to this branch
3 - Use advanced search to limit search to only Orly
4 - Oh really bad, the search fails!
5 - Apply patch
6 - Repeat search
7 - Oh really good, the search succeeds
8 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t