From ded73fbb94ee4290a2e9f2a0080d00233d21f9a8 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 Signed-off-by: Ben Shum --- .../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 88f564ec77..89fe1b445f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm @@ -288,7 +288,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.43.2