From ce8ed82b22a037f298f1b6db229073862b37f403 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Fri, 16 Sep 2011 19:38:06 +0200 Subject: [PATCH] Bug 6875 de-nesting C4::Heading Content-Type: text/plain; charset="UTF-8" C4::Search is needed only in authorities sub, moving it here and switching to require Signed-off-by: Jared Camins-Esakov Corrected call to SimpleSearch in both subs where it is used. Additional performance improvements are included in bug 7284. 28 Jan 2012 --- C4/Heading.pm | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/C4/Heading.pm b/C4/Heading.pm index ba9d23f..d9e13d4 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -23,7 +23,6 @@ use MARC::Record; use MARC::Field; use C4::Context; use C4::Heading::MARC21; -use C4::Search; use Carp; our $VERSION = 3.00; @@ -109,7 +108,8 @@ sub authorities { my $self = shift; my $query = qq(Match-heading,do-not-truncate,ext="$self->{'search_form'}"); $query .= $self->_query_limiters(); - my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); + require C4::Search; + my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); if (defined $error) { carp "Error:$error from search $query"; } @@ -129,7 +129,8 @@ sub preferred_authorities { my $self = shift; my $query = "Match-heading-see-from,do-not-truncate,ext='$self->{'search_form'}'"; $query .= $self->_query_limiters(); - my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); + require C4::Search; + my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); if (defined $error) { carp "Error:$error from search $query"; } -- 1.7.2.5