From 0c7d6db8d7ed1f7158a7210bd0e6f916f720a842 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Jan 2016 11:22:07 +0000 Subject: [PATCH] Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (2) C4::Branch::GetBranchesInCategory can be replaced with Koha::LibraryCategory->libraries Test plan: 1/ Define some 1+ group of libraries with 1+ libraries each 2/ Go on the advanced search (OPAC and Staff) and select a group of libraries 3/ The result should be consistent and only include record from these libraries Signed-off-by: Owen Leonard Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- catalogue/search.pl | 4 +++- opac/opac-search.pl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 25b9855a91..dbc12d27cd 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -423,7 +423,9 @@ my %is_nolimit = map { $_ => 1 } @nolimits; @limits = grep { not $is_nolimit{$_} } @limits; if($params->{'multibranchlimit'}) { - my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; + my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); + my @libraries = $library_category->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 6a9403cfd3..e75c74ac94 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -480,7 +480,9 @@ if (@searchCategories > 0) { @limits = map { uri_unescape($_) } @limits; if($params->{'multibranchlimit'}) { - my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; + my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); + my @libraries = $library_category->libraries; + my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; push @limits, $multibranch if ($multibranch ne '()'); } -- 2.39.5