From c06766841c21bbb0d590133a5990bab0f3a20482 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 Signed-off-by: Henri-Damien LAURENT --- 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 2a57604cb8..859f021870 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -54,9 +54,16 @@ use C4::Serials; # uses getsubscriptionfrom biblionumber use C4::Koha; # use getitemtypeinfo use C4::Members; # GetMember -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); @@ -67,6 +74,7 @@ my $record = GetMarcBiblio($biblionumber); #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 ); @@ -83,16 +91,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