Bug 20321: Remove get_biblionumber_from_isbn
authorNick Clemens <nick@bywatersolutions.com>
Thu, 1 Mar 2018 16:30:35 +0000 (16:30 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 19 Mar 2018 16:55:47 +0000 (13:55 -0300)
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 <roch.damour@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

C4/XISBN.pm
catalogue/detail.pl
opac/opac-detail.pl
t/db_dependent/XISBN.t

index f3d202f..884d772 100644 (file)
@@ -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
index b29d858..1d61967 100755 (executable)
@@ -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);
index e7653d9..088039a 100755 (executable)
@@ -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;
index df598ce..23fea72 100755 (executable)
@@ -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." );