From c9bcaf13c0ec162d25532cc58de2f50dc6e6796f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 30 May 2018 14:41:14 -0300 Subject: [PATCH] Bug 20838: (bug 16735 follow-up) Fix search by group of libraries Content-Type: text/plain; charset=utf-8 In the last patches of bug 16735, we completely broke the feature! The limit is using library_groups.id instead of branches.branchcode. Test plan: Create a group of library with the search feature Search (OPAC and staff interfaces) using this limit => Without this patch you will see that the generated search query does not contain branchcodes => With this patch applied you will see the branchcodes Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy --- 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 27b36b7..6fc96d6 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -399,7 +399,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: ' . $_->id } @libraries ) .')'; + my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; push @limits, $multibranch if ($multibranch ne '()'); } diff --git a/opac/opac-search.pl b/opac/opac-search.pl index f89e521..1d7615b 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -493,7 +493,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: ' . $_->id } @libraries ) .')'; + my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; push @limits, $multibranch if ($multibranch ne '()'); } -- 2.1.4