From 33996aab955ce04b690e7c0f15b9ec349b9ba00b Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 3 Apr 2009 18:15:08 -0500 Subject: [PATCH] bug 3088: fix crash in opac-ISBDdetail.pl Signed-off-by: Galen Charlton --- opac/opac-ISBDdetail.pl | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 31bd32eee4..463efb896d 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -55,9 +55,16 @@ use C4::Koha; use C4::Members; # GetMember use C4::External::Amazon; -my $query = new CGI; - -my $dbh = C4::Context->dbh; +my $query = CGI->new(); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "opac-ISBDdetail.tmpl", + query => $query, + type => "opac", + authnotrequired => 1, + debug => 1, + } +); my $biblionumber = $query->param('biblionumber'); my $itemtype = &GetFrameworkCode($biblionumber); @@ -84,6 +91,7 @@ $template->param( #coping with subscriptions my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber); +my $dbh = C4::Context->dbh; my $dat = TransformMarcToKoha( $dbh, $record ); my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber ); @@ -104,16 +112,6 @@ foreach my $subscription (@subscriptions) { push @subs, \%cell; } -# open template -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "opac-ISBDdetail.tmpl", - query => $query, - type => "opac", - authnotrequired => 1, - debug => 1, - } -); $template->param( subscriptions => \@subs, subscriptionsnumber => $subscriptionsnumber, -- 2.39.5