From eb759719908949bc5f7c388d26d4e9dd28b1e415 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 25 May 2023 06:03:48 +0000 Subject: [PATCH] Bug 33404: Fix serverhost and init $page The array serverhost is not filled. Should be replaced with values from servers array. Test plan: Nothing exciting here. Read the patch. Note that we will test in the next patch if the hostname is saved correctly in the import batch. Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- C4/Breeding.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 45a0563dcc..8bfa513bca 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -503,14 +503,13 @@ sub Z3950SearchAuth { my $dbh = C4::Context->dbh; my @id= @{$pars->{id}}; - my $page= $pars->{page}; + my $page= $pars->{page} // 1; my $show_next = 0; my $total_pages = 0; my @encoding; my @results; - my @serverhost; my @breeding_loop = (); my @oConnection; my @oResult; @@ -562,7 +561,7 @@ sub Z3950SearchAuth { my ($error )= $oConnection[$k]->error_x(); #ignores errmsg, addinfo, diagset if ($error) { if ($error =~ m/^(10000|10007)$/ ) { - push(@errconn, {'server' => $serverhost[$k]}); + push @errconn, { server => $servers[$k]->{host} }; } } else { @@ -596,7 +595,7 @@ sub Z3950SearchAuth { my $heading_authtype_code = GuessAuthTypeCode($marcrecord) or next; my $heading = GetAuthorizedHeading({ record => $marcrecord }); - my $breedingid = ImportBreedingAuth( $marcrecord, $serverhost[$k], 'UTF-8', $heading ); + my $breedingid = ImportBreedingAuth( $marcrecord, $servers[$k]->{host}, 'UTF-8', $heading ); my %row_data; $row_data{server} = $servers[$k]->{'servername'}; $row_data{breedingid} = $breedingid; -- 2.39.5