Bugzilla – Attachment 28044 Details for
Bug 12214
SQL errors in reports are not shown to user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix DB erros not showing to the user
0001-Bug-12214-SQL-errors-in-reports-are-not-shown-to-use.patch (text/plain), 1.76 KB, created by
paxed
on 2014-05-08 07:21:11 UTC
(
hide
)
Description:
Fix DB erros not showing to the user
Filename:
MIME Type:
Creator:
paxed
Created:
2014-05-08 07:21:11 UTC
Size:
1.76 KB
patch
obsolete
>From d0040d8f9870b9e7baaf7f23fb614ad72be78a1c Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@pttk.fi> >Date: Thu, 8 May 2014 10:11:29 +0300 >Subject: [PATCH] Bug 12214: SQL errors in reports are not shown to user > >When a user runs a report containing an SQL error, no >error is shown to the user. > >To test: >1) Run a report with known good SQL. >2) No error is shown. >3) Run a report with bad SQL (eg. a typo in field name) >4) No error is shown. >5) Apply patch >6) Repeat 1-4. For the bad SQL report, the database error > should be shown. >--- > C4/Reports/Guided.pm | 1 + > reports/guided_reports.pl | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 2381483..4b0ab6f 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -512,6 +512,7 @@ sub execute_query { > > my $sth = C4::Context->dbh->prepare($sql); > $sth->execute(@$sql_params, $offset, $limit); >+ return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err); > return ( $sth ); > # my @xmlarray = ... ; > # my $url = "/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=$id"; >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 71882af..9cb25ea 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -753,7 +753,7 @@ elsif ($phase eq 'Run this report'){ > 'execute' => 1, > 'name' => $name, > 'notes' => $notes, >- 'errors' => $errors, >+ 'errors' => defined($errors) ? [ $errors ] : undef, > 'pagination_bar' => pagination_bar($url, $totpages, $input->param('page')), > 'unlimited_total' => $total, > 'sql_params' => \@sql_params, >-- >1.8.3.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12214
:
28044
|
28115
|
28116
|
28117
|
28132
|
28133
|
28134
|
28135
|
28136