From aa65df89ed0cab3116ed2272a755220947e735e2 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Sat, 28 Apr 2012 17:24:06 -0400 Subject: [PATCH] Teach Syndetic.pm to pass UPC in requests Teach OpenILS::WWW::AddedContent::Syndetic to pass UPC when requesting added content from the source. Protect against warnings when no isbn/upc provided Protect against Perl giving us uninitialized value warnings when isbn or upc has not been provided. Signed-off-by: Jeff Godin --- Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm index 90d0e0aeaa..bddd21751c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm @@ -258,7 +258,10 @@ sub fetch_response { my $isbn = $keys->{isbn}[0]; my $upc = $keys->{upc}[0]; - my $url = $self->base_url . "?isbn=$isbn/$page&client=$uname" . (($notype) ? '' : "&type=rw12"); + $isbn = '' if !defined($isbn); + $upc = '' if !defined($upc); + + my $url = $self->base_url . "?isbn=$isbn/$page&upc=$upc&client=$uname" . (($notype) ? '' : "&type=rw12"); return $AC->get_url($url); } -- 2.11.0