From 5e0e1eeb1a72990084d7ef63136a35cadd9485c6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 1 Mar 2018 16:30:35 +0000 Subject: [PATCH] Bug 20321 - Remove get_biblionumber_from_isbn To test: 1 - grep get_biblionumber_from_isbn 2 - verify all occurences are not actual calls (except for test) 3 - Apply patch 4 - grep get_biblionumber_from_isbn 5 - Verify it is removed Signed-off-by: Roch D'Amour --- C4/XISBN.pm | 11 ----------- catalogue/detail.pl | 2 +- opac/opac-detail.pl | 2 +- t/db_dependent/XISBN.t | 9 ++------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/C4/XISBN.pm b/C4/XISBN.pm index f3d202f..884d772 100644 --- a/C4/XISBN.pm +++ b/C4/XISBN.pm @@ -39,20 +39,9 @@ BEGIN { @ISA = qw(Exporter); @EXPORT_OK = qw( &get_xisbns - &get_biblionumber_from_isbn ); } -sub get_biblionumber_from_isbn { - my $isbn = shift; - $isbn.='%'; - my @biblionumbers; - my $dbh=C4::Context->dbh; - my $query = "SELECT biblionumber FROM biblioitems WHERE isbn LIKE ? LIMIT 10"; - my $sth = $dbh->prepare($query); - $sth->execute($isbn); - return $sth->fetchall_arrayref({}); -} =head1 NAME C4::XISBN - Functions for retrieving XISBN content in Koha diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 58d4511..adf3737 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -30,7 +30,7 @@ use C4::Items; use C4::Circulation; use C4::Reserves; use C4::Serials; -use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn); +use C4::XISBN qw(get_xisbns); use C4::External::Amazon; use C4::Search; # enabled_staff_search_views use C4::Tags qw(get_tags); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e7653d9..088039a 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -32,7 +32,7 @@ use C4::Biblio; use C4::Items; use C4::Circulation; use C4::Tags qw(get_tags); -use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn); +use C4::XISBN qw(get_xisbns); use C4::External::Amazon; use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes ); use C4::Members; diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t index df598ce..23fea72 100755 --- a/t/db_dependent/XISBN.t +++ b/t/db_dependent/XISBN.t @@ -5,7 +5,7 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 4; use MARC::Record; use C4::Biblio; use C4::XISBN; @@ -45,12 +45,7 @@ my $biblionumber1 = _add_biblio_with_isbn($isbn1); my $biblionumber2 = _add_biblio_with_isbn($isbn2); my $biblionumber3 = _add_biblio_with_isbn($isbn3); -my $trial = C4::XISBN::get_biblionumber_from_isbn($isbn1); -is( $trial->[0]->{biblionumber}, - $biblionumber1, - "It gets the correct biblionumber from the only isbn we have added." ); - -$trial = C4::XISBN::_get_biblio_from_xisbn($isbn1); +my $trial = C4::XISBN::_get_biblio_from_xisbn($isbn1); is( $trial->{biblionumber}, $biblionumber1, "Gets biblionumber like the previous test." ); -- 2.7.4