Bug 21226: Remove xISBN services
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 15 Aug 2018 14:58:12 +0000 (11:58 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 27 Sep 2018 07:33:32 +0000 (09:33 +0200)
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 <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bce549bc4c0f9fefddb34fe614f6bf79aef882ea)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7cacd4ddb90d55238e0446a67ce4d68a54c58e3e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 42a4c281cde74fad9145c438bd7a97b1521f0a6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

C4/UsageStats.pm
C4/XISBN.pm
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
t/db_dependent/UsageStats.t
t/db_dependent/XISBN.t

index 96e79fa..a1d9237 100644 (file)
@@ -215,7 +215,6 @@ sub BuildReport {
         LocalCoverImages
         OPACLocalCoverImages
         NovelistSelectEnabled
-        XISBN
         OpenLibraryCovers
         OpenLibrarySearch
         UseKohaPlugins
index 00a4ce4..280968e 100644 (file)
@@ -88,7 +88,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;
@@ -104,21 +104,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
 
index f62882d..2863715 100644 (file)
@@ -180,22 +180,6 @@ Enhanced Content:
                   yes: Add
                   no: "Don't add"
             - the rating from <a href='https://idreambooks.com/'>IDreamBooks.com</a> 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 <a href="http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp">OCLC affiliate ID</a>
-            - 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
index 5f4dfad..e5801bd 100644 (file)
@@ -468,7 +468,6 @@ sub mocking_systempreferences_to_a_set_value {
         LocalCoverImages
         OPACLocalCoverImages
         NovelistSelectEnabled
-        XISBN
         OpenLibraryCovers
         OpenLibrarySearch
         UseKohaPlugins
index df598ce..c656a38 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;
@@ -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