From 79e1008cef66345106328487c712ef6dde7f3507 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 20 Feb 2015 07:23:15 -0500 Subject: [PATCH] Bug 12858 [QA Followup] - Don't call webservice if we have no data Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/External/Syndetics.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/External/Syndetics.pm b/C4/External/Syndetics.pm index 2d14674caa..50f1e64920 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; } -- 2.39.5