From 41d550df4fd72a0f53ad096b32ff8b9aa84bd8ac Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Wed, 11 Mar 2009 13:25:40 -0600 Subject: [PATCH] bug: add items to label batch - need userenv loaded before call to SimpleSearch Since I added more IndependantBranches code to my git repo I need userenv loaded before SimpleSearch() is called. I think get_template_and_user() should be called as soon as possible. In this case it could mean two calls, but it has to be so. Signed-off-by: Galen Charlton --- labels/label-item-search.pl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 140f5d7e26..a04a9dc03a 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -82,6 +82,18 @@ if ( $op eq "do_search" ) { $datefrom = $query->param('datefrom'); $dateto = $query->param('dateto'); + ( $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, + } + ); + if ($datefrom) { $datefrom = C4::Dates->new($datefrom); $ccl_query .= ' and ' if $ccl_textbox; @@ -177,18 +189,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, - } - ); - # build page nav stuff. my ( @field_data, @numbers ); $total = $total_hits; -- 2.39.5