From 13388132cdd5c806af9ef720157b4f2f8d77f3f9 Mon Sep 17 00:00:00 2001 From: kados Date: Sat, 25 Feb 2006 22:47:37 +0000 Subject: [PATCH] Changed to use new Zconn object in Context.pm. Not sure if the Zconn should be set within the subroutine or should be passed in via the script -- Chris, what do you think? --- C4/Search.pm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ca6d5a4861..fedd772f82 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -62,12 +62,8 @@ sub search { my ( $search, $type, $number ) = @_; my $dbh = C4::Context->dbh(); my $q; - my $Zconn; + my $Zconn = C4::Context->Zconn; my $raw; - eval { $Zconn = new ZOOM::Connection( C4::Context->config("zebradb") ); }; - if ($@) { - warn "Error ", $@->code(), ": ", $@->message(), "\n"; - } if ( $type eq 'CQL' ) { my $string; @@ -79,9 +75,6 @@ sub search { $string .= "$var=\"$search->{$var}\" "; } } - $Zconn->option( cqlfile => C4::Context->config("intranetdir") - . "/zebra/pqf.properties" ); - $Zconn->option( preferredRecordSyntax => "xml" ); $q = new ZOOM::Query::CQL2RPN( $string, $Zconn ); } my $rs; @@ -112,15 +105,8 @@ sub get_record { # pass in an id (biblionumber at this stage) and get back a MARC record my ($id) = @_; my $q; - my $Zconn; + my $Zconn = C4::Context->Zconn my $raw; - eval { $Zconn = new ZOOM::Connection( C4::Context->config("zebradb") ); }; - if ($@) { - warn "Error ", $@->code(), ": ", $@->message(), "\n"; - } - $Zconn->option( cqlfile => C4::Context->config("intranetdir") - . "/zebra/pqf.properties" ); - $Zconn->option( preferredRecordSyntax => "xml" ); my $string = "identifier=$id"; warn $string; -- 2.39.5