From fd4ed72988a0a00a97a9a74bd89b017453bb276b Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 16 Sep 2009 18:36:40 +0200 Subject: [PATCH] Bug Fixing Amazon.pm would not compile missing call of C4::External::Amazon in opac-ISBDdetail.pl @aws was not defined --- C4/External/Amazon.pm | 6 +++++- opac/opac-ISBDdetail.pl | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/C4/External/Amazon.pm b/C4/External/Amazon.pm index 492577cc1d..ced64c7e8a 100644 --- a/C4/External/Amazon.pm +++ b/C4/External/Amazon.pm @@ -80,7 +80,11 @@ Get editorial reviews, customer reviews, and similar products using Amazon Web S =cut sub get_amazon_details { - my ( $isbn, $record, $marcflavour ) = @_; + my ( $isbn, $record, $marcflavour,$awsref ) = @_; + + return unless defined $aws_ref; + my @aws = @$aws_ref; + return if $#aws == -1; #normalize the ISBN $isbn = _normalize_match_point ($isbn); diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 7ba19cf3b5..02e50fe281 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -51,6 +51,7 @@ use CGI; use MARC::Record; use C4::Biblio; use C4::Acquisition; +use C4::External::Amazon; use C4::Review; use C4::Serials; # uses getsubscriptionfrom biblionumber use C4::Koha; # use getitemtypeinfo @@ -116,6 +117,15 @@ $template->param( biblionumber => $biblionumber, reviews => $reviews, ); + my @services; + if ( $amazon_reviews ) { + $template->param( AmazonReviews => 1 ); + push( @services, 'EditorialReview' ); + } + if ( $amazon_similars ) { + $template->param( AmazonSimilarItems => 1 ); + push( @services, 'Similarities' ); + } ## Amazon.com stuff #not used unless preference set -- 2.39.5