[Koha-patches] [PATCH] Bad check of a variable, disabling exporting with "guided reports" (bug #2672(only in 3.0.x))

Joe Atzberger joe.atzberger at liblime.com
Tue Oct 14 17:53:51 CEST 2008


Nahuel --

This may have already been patched.

The comparison in my test version of Koha is:
if ($#$errors == -1) ...

In any case, this is an incorrect patch on the face of it, using string
comparison (eq) against 0.

--Joe

On Tue, Oct 14, 2008 at 11:29 AM, Nahuel Angelinetti <
nahuel.angelinetti at biblibre.com> wrote:

> ---
>  reports/guided_reports.pl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl
> index 9d80314..1fa939b 100755
> --- a/reports/guided_reports.pl
> +++ b/reports/guided_reports.pl
> @@ -399,7 +399,7 @@ elsif ($phase eq 'Export'){
>        my $sql = $input->param('sql');
>         my $format = $input->param('format');
>        my ($results, $total, $errors) = execute_query($sql,1,0,0,$format);
> -        if (!defined($errors)) {
> +        if ( @$errors eq 0 ) {
>             $no_html=1;
>             print $input->header(       -type =>
> 'application/octet-stream',
>                                         -attachment=>'reportresults.csv'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20081014/5405dc0c/attachment-0002.htm>


More information about the Koha-patches mailing list