View | Details | Raw Unified | Return to bug 12537
Collapse All | Expand All

(-)a/C4/XISBN.pm (-3 / +3 lines)
Lines 72-85 sub _get_biblio_from_xisbn { Link Here
72
    return $biblio;
72
    return $biblio;
73
}
73
}
74
74
75
=head1 get_xisbns($isbn);
75
=head1 get_xisbns($isbn, $biblionumber);
76
76
77
=head2 $isbn is an ISBN string
77
=head2 $isbn is an ISBN string
78
78
79
=cut
79
=cut
80
80
81
sub get_xisbns {
81
sub get_xisbns {
82
    my ( $isbn ) = @_;
82
    my ( $isbn, $biblionumber ) = @_;
83
    my ($response,$thing_response,$syndetics_response,$errors);
83
    my ($response,$thing_response,$syndetics_response,$errors);
84
    # THINGISBN
84
    # THINGISBN
85
    if ( C4::Context->preference('ThingISBN') ) {
85
    if ( C4::Context->preference('ThingISBN') ) {
Lines 107-113 sub get_xisbns { Link Here
107
        next if $unique_xisbns->{ $response_data->{content} };
107
        next if $unique_xisbns->{ $response_data->{content} };
108
        $unique_xisbns->{ $response_data->{content} }++;
108
        $unique_xisbns->{ $response_data->{content} }++;
109
        my $xbiblio= _get_biblio_from_xisbn($response_data->{content});
109
        my $xbiblio= _get_biblio_from_xisbn($response_data->{content});
110
        push @xisbns, $xbiblio if $xbiblio;
110
        push @xisbns, $xbiblio if $xbiblio && $xbiblio->{biblionumber} ne $biblionumber;
111
    }
111
    }
112
    if ( wantarray ) {
112
    if ( wantarray ) {
113
        return (\@xisbns, $errors);
113
        return (\@xisbns, $errors);
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 461-467 if (C4::Context->preference("virtualshelves") ) { Link Here
461
if (C4::Context->preference("FRBRizeEditions")==1) {
461
if (C4::Context->preference("FRBRizeEditions")==1) {
462
    eval {
462
    eval {
463
        $template->param(
463
        $template->param(
464
            XISBNS => scalar get_xisbns($isbn)
464
            XISBNS => scalar get_xisbns($isbn, $biblionumber)
465
        );
465
        );
466
    };
466
    };
467
    if ($@) { warn "XISBN Failed $@"; }
467
    if ($@) { warn "XISBN Failed $@"; }
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 919-925 if (C4::Context->preference("virtualshelves") ) { Link Here
919
if (C4::Context->preference("OPACFRBRizeEditions")==1) {
919
if (C4::Context->preference("OPACFRBRizeEditions")==1) {
920
    eval {
920
    eval {
921
        $template->param(
921
        $template->param(
922
            XISBNS => scalar get_xisbns($isbn)
922
            XISBNS => scalar get_xisbns($isbn, $biblionumber)
923
        );
923
        );
924
    };
924
    };
925
    if ($@) { warn "XISBN Failed $@"; }
925
    if ($@) { warn "XISBN Failed $@"; }
(-)a/t/db_dependent/XISBN.t (-2 / +19 lines)
Lines 5-11 Link Here
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
7
8
use Test::More tests => 3;
8
use Test::More tests => 5;
9
use MARC::Record;
9
use MARC::Record;
10
use C4::Biblio;
10
use C4::Biblio;
11
use C4::XISBN;
11
use C4::XISBN;
Lines 62-67 SKIP: { Link Here
62
        "Gets correct biblionumber from a book with a similar isbn using ThingISBN." );
62
        "Gets correct biblionumber from a book with a similar isbn using ThingISBN." );
63
}
63
}
64
64
65
eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1,$biblionumber1); };
66
SKIP: {
67
    skip "Problem retrieving ThingISBN", 1
68
        unless $@ eq '';
69
    is( $results_thingisbn->[0]->{biblionumber},
70
        $biblionumber3,
71
        "Gets correct biblionumber from a different book with a similar isbn using ThingISBN." );
72
}
73
74
eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1,$biblionumber3); };
75
SKIP: {
76
    skip "Problem retrieving ThingISBN", 1
77
        unless $@ eq '';
78
    is( $results_thingisbn->[0]->{biblionumber},
79
        undef,
80
        "Doesn't get biblionumber if the biblionumber matches the one passed to the sub." );
81
}
82
65
# Util subs
83
# Util subs
66
84
67
# Add new biblio with isbn and return biblionumber
85
# Add new biblio with isbn and return biblionumber
68
- 

Return to bug 12537