]> 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)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Thu, 11 Aug 2022 07:21:33 +0000 (09:21 +0200)
commit334282b4bfecf5dc108d87bde801181d6bb3e573
tree322d76e803e9af150a657cacab1c831875225642
parent1df5e78deb59d1ae87d315389c84a77ef9409194
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>
(cherry picked from commit a4c5bd58361900983f870f1c0e7f497ae3618c85)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 584c49961c71d91e2698025d216752a40fe0eb08)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t