From 94eb0052ab6c7c3cbf847be7664c5fc661908870 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 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 Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- 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 27b36b7802..6fc96d638f 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 f89e521665..1d7615bc5c 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.39.5