From fe5618cfc63a8db9bd437af5dfbaf646341d21e1 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 22 Aug 2017 22:36:15 +0000 Subject: [PATCH] Bug 14385: Corrected opac-details searchResult call --- opac/opac-detail.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 4374c95..9d24429 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -81,13 +81,13 @@ $biblionumber = int($biblionumber); my @all_items = GetItemsInfo($biblionumber); my @hiddenitems; +my $borcat = q{}; if ( scalar @all_items >= 1 ) { - my $borcat; if ( C4::Context->preference('OpacHiddenItemsExceptions') ) { # we need to fetch the borrower info here, so we can pass the category my $borrower = Koha::Patrons->find( { borrowernumber => $borrowernumber } ); - $borcat = $borrower ? $borrower->categorycode : q{}; + $borcat = $borrower ? $borrower->categorycode : $borcat; } push @hiddenitems, @@ -237,10 +237,14 @@ if ($session->param('busc')) { }; my $hits; my @newresults; + my $search_context = { + 'interface' => 'opac', + 'category' => $borcat + }; for (my $i=0;$i<@servers;$i++) { my $server = $servers[$i]; $hits = $results_hashref->{$server}->{"hits"}; - @newresults = searchResults({ 'interface' => 'opac' }, '', $hits, $results_per_page, $offset, $arrParamsBusc->{'scan'}, $results_hashref->{$server}->{"RECORDS"}); + @newresults = searchResults( $search_context, '', $hits, $results_per_page, $offset, $arrParamsBusc->{'scan'}, $results_hashref->{$server}->{"RECORDS"}); } return \@newresults; }#searchAgain -- 2.1.4