From 308b409cc5068a4b732a9f447f4a58083d44d986 Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Thu, 16 Oct 2008 13:59:44 -0600 Subject: [PATCH] fix calls to get_template_and_user in label-item-search.pl remove extra flagsrequired line. move call in first branch to the top. This will be important is IndepenantBranches code is later added to, for example, C4::Items::get_itemnumbers_of() Signed-off-by: Galen Charlton --- labels/label-item-search.pl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 68716167a2..9f97dfba0f 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -86,6 +86,17 @@ if ( $op eq "do_search" ) { } if ( $show_results ) { + ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "labels/result.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { catalogue => 1 }, + debug => 1, + } + ); + my $hits = $show_results; my (@results, @items); # This code needs to be refactored using these subs... @@ -126,18 +137,6 @@ if ( $show_results ) { $debug and warn "**********\@results**********\n"; $debug and warn Dumper(@results); - ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "labels/result.tmpl", - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => { borrowers => 1 }, - flagsrequired => { catalogue => 1 }, - debug => 1, - } - ); - my @field_data = (); # FIXME: this relies on symmetric order of CGI params that IS NOT GUARANTEED by spec. -- 2.20.1