From 42a4c281cde74fad9145c438bd7a97b1521f0a6d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Aug 2018 11:58:12 -0300 Subject: [PATCH] Bug 21226: Remove xISBN services OCLC has decided to retire all xISBN services: https://www.oclc.org/developer/news/2018/xid-decommission.en.html The code for related features has to be removed from Koha. Test plan: You need to be familiar with the different sysprefs (I am not): - FRBRizeEditions - SyndeticsEnabled - SyndeticsEditions - ThingISBN Make sure there are no regressions introduced by this patchset. QA Note: C4/XISBN.pm should be renammed Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens (cherry picked from commit bce549bc4c0f9fefddb34fe614f6bf79aef882ea) Signed-off-by: Martin Renvoize (cherry picked from commit 7cacd4ddb90d55238e0446a67ce4d68a54c58e3e) Signed-off-by: Fridolin Somers --- C4/UsageStats.pm | 1 - C4/XISBN.pm | 18 ++---------------- .../admin/preferences/enhanced_content.pref | 16 ---------------- t/db_dependent/UsageStats.t | 1 - t/db_dependent/XISBN.t | 17 +---------------- 5 files changed, 3 insertions(+), 50 deletions(-) diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 8c429b29dd..86163a5431 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -216,7 +216,6 @@ sub BuildReport { LocalCoverImages OPACLocalCoverImages NovelistSelectEnabled - XISBN OpenLibraryCovers OpenLibrarySearch UseKohaPlugins diff --git a/C4/XISBN.pm b/C4/XISBN.pm index cff35c94d7..c40da3ae2b 100644 --- a/C4/XISBN.pm +++ b/C4/XISBN.pm @@ -91,7 +91,7 @@ sub _get_biblio_from_xisbn { sub get_xisbns { my ( $isbn ) = @_; - my ($response,$thing_response,$xisbn_response,$syndetics_response,$errors); + my ($response,$thing_response,$syndetics_response,$errors); # THINGISBN if ( C4::Context->preference('ThingISBN') ) { my $url = "http://www.librarything.com/api/thingISBN/".$isbn; @@ -107,21 +107,7 @@ sub get_xisbns { $syndetics_response = {isbn => \@syndetics_response}; } - # XISBN - if ( C4::Context->preference('XISBN') ) { - my $affiliate_id=C4::Context->preference('OCLCAffiliateID'); - my $limit = C4::Context->preference('XISBNDailyLimit') || 999; - my $reached_limit = _service_throttle('xisbn',$limit); - my $url = "http://xisbn.worldcat.org/webservices/xid/isbn/".$isbn."?method=getEditions&format=xml&fl=form,year,lang,ed"; - $url.="&ai=".$affiliate_id if $affiliate_id; - unless ($reached_limit) { - $xisbn_response = _get_url($url,'xisbn'); - } - $errors->{xisbn} = $xisbn_response->{ stat } - if $xisbn_response->{ stat } ne 'ok'; - } - - $response->{isbn} = [ @{ $xisbn_response->{isbn} or [] }, @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ]; + $response->{isbn} = [ @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ]; my @xisbns; my $unique_xisbns; # a hashref diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index f62882d966..286371547f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -180,22 +180,6 @@ Enhanced Content: yes: Add no: "Don't add" - the rating from IDreamBooks.com to OPAC search results. - OCLC: - - - - pref: XISBN - choices: - yes: Use - no: "Don't use" - - the OCLC xISBN service to show other editions of a title (when either FRBRizeEditions or OPACFRBRizeEditions is on). - - - - Use the OCLC affiliate ID - - pref: OCLCAffiliateID - - to access the xISBN service. Note that unless you have signed up for an ID, you are limited to 1000 requests per day. - - - - Only use the xISBN service - - pref: XISBNDailyLimit - class: integer - - times a day. Unless you are paying for the xISBN service, you should leave this at the default of 999 (as detailed above). Syndetics: - - pref: SyndeticsEnabled diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index ddb01d5989..d482033a90 100644 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -469,7 +469,6 @@ sub mocking_systempreferences_to_a_set_value { LocalCoverImages OPACLocalCoverImages NovelistSelectEnabled - XISBN OpenLibraryCovers OpenLibrarySearch UseKohaPlugins diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t index df598ceabb..c656a38923 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; @@ -56,7 +56,6 @@ is( $trial->{biblionumber}, ## Test ThingISBN t::lib::Mocks::mock_preference( 'ThingISBN', 1 ); -t::lib::Mocks::mock_preference( 'XISBN', 0 ); my $results_thingisbn; eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1); }; @@ -68,20 +67,6 @@ SKIP: { "Gets correct biblionumber from a book with a similar isbn using ThingISBN." ); } -## Test XISBN -t::lib::Mocks::mock_preference( 'ThingISBN', 0 ); -t::lib::Mocks::mock_preference( 'XISBN', 1 ); - -my $results_xisbn; -eval { ($results_xisbn, $errors) = C4::XISBN::get_xisbns($isbn1); }; -SKIP: { - skip "Problem retrieving XISBN (" . $errors->{xisbn} . ")", 1 - if $errors->{xisbn}; - is( $results_xisbn->[0]->{biblionumber}, - $biblionumber3, - "Gets correct biblionumber from a book with a similar isbn using XISBN." ); -} - $dbh->rollback; # Util subs -- 2.39.5