[Koha-patches] [PATCH] fix calls to get_template_and_user in label-item-search.pl
Joe Atzberger
joe.atzberger at liblime.com
Tue Oct 7 21:22:28 CEST 2008
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20081007/6f7f9afc/attachment-0002.htm>
More information about the Koha-patches
mailing list