From 4563a75c3576f08d370e089e4d3de288464930d3 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 18 Jun 2021 15:20:30 -0300 Subject: [PATCH] Bug 28600: Resolve variable scope issue This patch fixes a scope issue. Originally, a variable declared as our $borcat was replaced by my $patron This patch makes the method not rely on global variables, but have a parameter for the patron, and thus things are clearer. To test: 1. Open the OPAC detail page for a record => FAIL: The logs show some errors about the $patron variable not available in the scope 2. Apply this patch 3. Repeat 1 => SUCCESS: No errors 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- opac/opac-detail.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 6173b72862..51491846ad 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -260,7 +260,7 @@ if ($session->param('busc')) { # Search given the current values from the busc param sub searchAgain { - my ($arrParamsBusc, $offset, $results_per_page) = @_; + my ($arrParamsBusc, $offset, $results_per_page, $patron) = @_; my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; my @servers; @@ -341,7 +341,7 @@ if ($session->param('busc')) { } $arrParamsBusc{'count'} = $count; $results_per_page = $count; - my $newresultsRef = searchAgain(\%arrParamsBusc, $offset, $results_per_page); + my $newresultsRef = searchAgain(\%arrParamsBusc, $offset, $results_per_page, $patron); $arrParamsBusc{'listBiblios'} = buildListBiblios($newresultsRef, $results_per_page); delete $arrParamsBusc{'previous'} if (exists($arrParamsBusc{'previous'})); delete $arrParamsBusc{'next'} if (exists($arrParamsBusc{'next'})); @@ -452,7 +452,7 @@ if ($session->param('busc')) { $offsetSearch = 0 if (defined($offsetSearch) && $offsetSearch < 0); } if ($searchAgain) { - my $newresultsRef = searchAgain(\%arrParamsBusc, $offsetSearch, $results_per_page); + my $newresultsRef = searchAgain(\%arrParamsBusc, $offsetSearch, $results_per_page, $patron); my @newresults = @$newresultsRef; # build the new listBiblios my $listBiblios = buildListBiblios(\@newresults, $results_per_page); -- 2.39.5