From f55beb0ddd7c79e932665c0f78f71f631fad1201 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 20 Feb 2015 07:23:15 -0500 Subject: [PATCH] [PASSED QA] Bug 12858 [QA Followup] - Don't call webservice if we have no data Signed-off-by: Kyle M Hall --- C4/External/Syndetics.pm | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/External/Syndetics.pm b/C4/External/Syndetics.pm index 2d14674..209eb5b 100644 --- a/C4/External/Syndetics.pm +++ b/C4/External/Syndetics.pm @@ -63,7 +63,9 @@ Get Summary data from Syndetics =cut sub get_syndetics_index { - my ( $isbn,$upc,$oclc ) = @_; + my ( $isbn, $upc, $oclc ) = @_; + + return unless( $isbn || $upc || $oclc ); my $response = _fetch_syndetics_content('INDEX.XML', $isbn, $upc, $oclc); unless ($response->content_type =~ /xml/) { @@ -80,9 +82,9 @@ sub get_syndetics_index { for my $available_type ('SUMMARY','TOC','FICTION','AWARDS1','SERIES1','SPSUMMARY','SPREVIEW', 'AVPROFILE', 'AVSUMMARY','DBCHAPTER','LJREVIEW','PWREVIEW','SLJREVIEW','CHREVIEW','BLREVIEW','HBREVIEW','KIREVIEW','CRITICASREVIEW','ANOTES') { if (exists $response->{$available_type} && $response->{$available_type} =~ /$available_type/) { $syndetics_elements->{$available_type} = $available_type; - #warn "RESPONSE: $available_type : $response->{$available_type}"; } } + return $syndetics_elements if $syndetics_elements; } -- 1.7.2.5