bug 2540: allow download of report
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 21 Aug 2008 15:48:31 +0000 (10:48 -0500)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 28 Oct 2008 21:09:24 +0000 (22:09 +0100)
$error return C4::Reports::execute_query is
always defined.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
reports/guided_reports.pl

index 9d80314..0c5d94b 100755 (executable)
@@ -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 == -1) {
             $no_html=1;
             print $input->header(       -type => 'application/octet-stream',
                                         -attachment=>'reportresults.csv'