[Koha-patches] [PATCH] fix calls to get_template_and_user in label-item-search.pl

Michael Hafen mdhafen at tech.washk12.org
Tue Oct 7 21:36:15 CEST 2008


Yeah, I should have researched that first.  Sorry.

I've looked at Auth.pm now, and I don't see this debug => 1 being used
anywhere in there.  Could this be left over from older code?  If it is
I'll happily re-post this patch without the debug => 1.

Thanks.

On Tue, 2008-10-07 at 15:22 -0400, Joe Atzberger wrote:
> Don't get confused by the different debug params.  My understanding is
> that as far as the templating is concerned, we always pass debug=>1 to
> get_template_and_user.  We don't want that value to be linked to
> C4::Debug's $debug or any other $debug.  
> 
> --joe
> 
> On Tue, Oct 7, 2008 at 3:15 PM, Michael Hafen
> <mdhafen at tech.washk12.org> wrote:
>         make debug conditional in call.
>         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()
>         ---
>          labels/label-item-search.pl |   25 ++++++++++++-------------
>          1 files changed, 12 insertions(+), 13 deletions(-)
>         
>         diff --git a/labels/label-item-search.pl
>         b/labels/label-item-search.pl
>         index 6871616..8ce38cc 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           => $debug,
>         +        }
>         +    );
>         +
>                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.
>         @@ -206,7 +205,7 @@ else {
>                     type            => "intranet",
>                     authnotrequired => 0,
>                     flagsrequired   => { catalogue => 1 },
>         -            debug           => 1,
>         +            debug           => $debug,
>                 }
>             );
>             my $itemtypes = GetItemTypes;
>         --
>         1.5.4.3
>         
>         _______________________________________________
>         Koha-patches mailing list
>         Koha-patches at lists.koha.org
>         http://lists.koha.org/mailman/listinfo/koha-patches
> 
> 




More information about the Koha-patches mailing list