From 3f3a7641f59a3c11cfbdc316f5c8b5b646c8d25d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Aug 2020 13:55:13 +0200 Subject: [PATCH] Bug 26133: Remove GetMarcHosts We removed the single occurrence of this subroutine in the previous patch Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 88ecaa54cdfec5d35091237821097877b0edb4eb) Signed-off-by: Lucas Gass --- C4/Biblio.pm | 48 ------------------------------------------------ t/Biblio.t | 8 +------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 41bdcc504a..895197d55a 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -38,7 +38,6 @@ BEGIN { GetMarcSubjects GetMarcAuthors GetMarcSeries - GetMarcHosts GetMarcUrls GetUsedMarcStructure GetXmlBiblio @@ -1861,53 +1860,6 @@ sub GetMarcSeries { return \@marcseries; } #end getMARCseriess -=head2 GetMarcHosts - - $marchostsarray = GetMarcHosts($record,$marcflavour); - -Get all host records (773s MARC21, 461 UNIMARC) from the MARC record and returns them in an array. - -=cut - -sub GetMarcHosts { - my ( $record, $marcflavour ) = @_; - if (!$record) { - carp 'GetMarcHosts called on undefined record'; - return; - } - - my ( $tag,$title_subf,$bibnumber_subf,$itemnumber_subf); - $marcflavour ||="MARC21"; - if ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) { - $tag = "773"; - $title_subf = "t"; - $bibnumber_subf ="0"; - $itemnumber_subf='9'; - } - elsif ($marcflavour eq "UNIMARC") { - $tag = "461"; - $title_subf = "t"; - $bibnumber_subf ="0"; - $itemnumber_subf='9'; - }; - - my @marchosts; - - foreach my $field ( $record->field($tag)) { - - my @fields_loop; - - my $hostbiblionumber = $field->subfield("$bibnumber_subf"); - my $hosttitle = $field->subfield($title_subf); - my $hostitemnumber=$field->subfield($itemnumber_subf); - push @fields_loop, { hostbiblionumber => $hostbiblionumber, hosttitle => $hosttitle, hostitemnumber => $hostitemnumber}; - push @marchosts, { MARCHOSTS_FIELDS_LOOP => \@fields_loop }; - - } - my $marchostsarray = \@marchosts; - return $marchostsarray; -} - =head2 UpsertMarcSubfield my $record = C4::Biblio::UpsertMarcSubfield($MARC::Record, $fieldTag, $subfieldCode, $subfieldContent); diff --git a/t/Biblio.t b/t/Biblio.t index 0550ce7826..5596b4bf19 100755 --- a/t/Biblio.t +++ b/t/Biblio.t @@ -21,7 +21,7 @@ use Test::More; use Test::MockModule; use Test::Warn; -plan tests => 43; +plan tests => 41; use_ok('C4::Biblio'); @@ -117,12 +117,6 @@ warning_is { $ret = GetMarcSeries() } ok( !defined $ret, 'GetMarcSeries returns undef if not passed rec'); -warning_is { $ret = GetMarcHosts() } - { carped => 'GetMarcHosts called on undefined record'}, - "GetMarcHosts returns carped warning on undef record"; - -ok( !defined $ret, 'GetMarcHosts returns undef if not passed rec'); - my $hash_ref; warning_is { $hash_ref = TransformMarcToKoha( undef) } -- 2.39.5