Bug 12858 [QA Followup] - Don't call webservice if we have no data
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 20 Feb 2015 12:23:15 +0000 (07:23 -0500)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 2 Apr 2015 09:03:21 +0000 (11:03 +0200)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 4c8c1e1cd0b2894404d3147e1f480dcdb6def330)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

C4/External/Syndetics.pm

index 2d14674..50f1e64 100644 (file)
@@ -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;
 }