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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb75971990)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ba442b1a3b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2023-05-25 06:03:48 +00:00 committed by Matt Blenkinsop
parent d25ad4d949
commit 9b7218373a
1 changed files with 3 additions and 4 deletions

View File

@ -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;