From 3e127df848f72ba4e32279bbfe8720eb4790f7d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 23 Feb 2023 15:46:48 +0100 Subject: [PATCH] Bug 33032: Remove alternateholdings_count Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit e36e393c7d05fc6e2af6391b908807655f6841e7) Signed-off-by: Matt Blenkinsop (cherry picked from commit 48bc9e54d8c2647fc58cf118665a0988321800d0) Signed-off-by: Lucas Gass (cherry picked from commit 8172a2ac1456ef3a60d6de59c91236acae44b2b1) Signed-off-by: Arthur Suzuki --- C4/Search.pm | 3 --- t/db_dependent/Search.t | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 912ee194a0..8b19d1ffe4 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2024,7 +2024,6 @@ sub searchResults { my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' '; my @alternateholdingsinfo = (); my @holdingsfields = $marcrecord->field(substr $fieldspec, 0, 3); - my $alternateholdingscount = 0; for my $field (@holdingsfields) { my %holding = ( holding => '' ); @@ -2038,12 +2037,10 @@ sub searchResults { } if ($havesubfield) { push(@alternateholdingsinfo, \%holding); - $alternateholdingscount++; } } $oldbiblio->{'ALTERNATEHOLDINGS'} = \@alternateholdingsinfo; - $oldbiblio->{'alternateholdings_count'} = $alternateholdingscount; } push( @newresults, $oldbiblio ); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 0879483d3a..a01ccfe3e2 100755 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -679,7 +679,7 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' ($error, $results_hashref, $facets_loop) = getRecords("Godzina pąsowej róży","Godzina pąsowej róży",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); @newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, $results_hashref->{'biblioserver'}->{"RECORDS"}); - is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly'); + is(scalar(@{$newresults[0]->{'ALTERNATEHOLDINGS'}}), 1, 'Alternate holdings filled in correctly'); ## Regression test for Bug 10741 -- 2.39.5