From 23ee004d9c6345d08f0e7e422efba6012372b3fe Mon Sep 17 00:00:00 2001 From: Andreas Jonsson Date: Fri, 24 Jan 2020 10:13:05 +0000 Subject: [PATCH] Bug 24506: Multibranch limit does not work with ElasticSearch Test plan 1. Set up a system with ElasticSearch 2. Set up or make sure ther are at least two branches 3. create a group of branches 4. make sure there are items associated with any library in the group 5. make a search in opac limited by the library group 6. make an advanced search in intra limited by the library group 7. change SearchEngine system preference to Zebra and repeat 5. and 6. Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 947db3b6cb77ea6cf68fa9218729068a303aab03) Signed-off-by: Lucas Gass --- catalogue/search.pl | 2 +- opac/opac-search.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index a3a7015efc..faa70968fe 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -408,7 +408,7 @@ my %is_nolimit = map { $_ => 1 } @nolimits; if($params->{'multibranchlimit'}) { my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); my @libraries = $search_group->all_libraries; - my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; + my $multibranch = '('.join( " OR ", map { '(homebranch: ' . $_->branchcode .')' } @libraries ) .')'; push @limits, $multibranch if ($multibranch ne '()'); } diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 2545683ed6..ff6e112a47 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -503,7 +503,7 @@ if (@searchCategories > 0) { if($params->{'multibranchlimit'}) { my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); my @libraries = $search_group->all_libraries; - my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; + my $multibranch = '('.join( " OR ", map { 'homebranch: ' . $_->branchcode } @libraries ) .')'; push @limits, $multibranch if ($multibranch ne '()'); } -- 2.39.5