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 <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2018-08-15 11:58:12 -03:00 committed by Nick Clemens
parent b19090c450
commit bce549bc4c
5 changed files with 3 additions and 50 deletions

View File

@ -216,7 +216,6 @@ sub BuildReport {
LocalCoverImages
OPACLocalCoverImages
NovelistSelectEnabled
XISBN
OpenLibraryCovers
OpenLibrarySearch
UseKohaPlugins

View File

@ -80,7 +80,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;
@ -96,21 +96,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

View File

@ -186,22 +186,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

View File

@ -469,7 +469,6 @@ sub mocking_systempreferences_to_a_set_value {
LocalCoverImages
OPACLocalCoverImages
NovelistSelectEnabled
XISBN
OpenLibraryCovers
OpenLibrarySearch
UseKohaPlugins

View File

@ -5,7 +5,7 @@
use Modern::Perl;
use Test::More tests => 4;
use Test::More tests => 3;
use MARC::Record;
use C4::Biblio;
use C4::XISBN;
@ -51,7 +51,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); };
@ -63,20 +62,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