]> 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)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 29 Jul 2022 15:11:44 +0000 (15:11 +0000)
commit584c49961c71d91e2698025d216752a40fe0eb08
tree4d63db9b5d4a72cae554d022761781c433dde0e5
parent4018461d492286b2c6eba9bb162001fd7dbcc38f
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>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t