Bug 12214

Summary: SQL errors in reports are not shown to user
Product: Koha Reporter: paxed <pasi.kallinen>
Component: ReportsAssignee: paxed <pasi.kallinen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: gmcharlt, kyle
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Fix DB erros not showing to the user
Bug 12214: add regression test for reporting error when running report with SQL error
Bug 12214: display SQL errors in reports to users
Bug 12214: (follow-up) correct POD of C4::Reports::Guided::execute_query()
[PASSED QA] Bug 12214: add regression test for reporting error when running report with SQL error
[PASSED QA] Bug 12214: display SQL errors in reports to users
[PASSED QA] Bug 12214: (follow-up) correct POD of C4::Reports::Guided::execute_query()
[PASSED QA] Bug 12214 [QA Followup] - Clean up reports-toolbar.inc, show Edit link when SQL has errors
[PASSED QA] Bug 12214 [QA Followup] - Clean up reports-toolbar.inc, show Edit link when SQL has errors

Description paxed 2014-05-08 07:18:54 UTC
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.
Comment 1 paxed 2014-05-08 07:21:11 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2014-05-08 16:13:19 UTC Comment hidden (obsolete)
Comment 3 Galen Charlton 2014-05-08 16:13:26 UTC Comment hidden (obsolete)
Comment 4 Galen Charlton 2014-05-08 16:13:35 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2014-05-09 13:22:11 UTC
When a report has an error in the query, the page does not display the "Edit" or "Run report" links that are shown for successful reports. While I see no reason have the "Run report" link here. I think having the "Edit" link would be very important!
Comment 6 Kyle M Hall (khall) 2014-05-09 13:36:21 UTC
Created attachment 28132 [details] [review]
[PASSED QA] Bug 12214: add regression test for reporting error when running report with SQL error

To test:

[1] Run prove -v t/db_dependent/Reports_Guided.t. Last test should
    fail.
[2] Apply the main patch.
[3] Run step 1 again.  This time, all tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall (khall) 2014-05-09 13:36:34 UTC
Created attachment 28133 [details] [review]
[PASSED QA] Bug 12214: display SQL errors in reports to users

When a user runs a report containing an SQL error, no
error is shown to the user.  This patch fixes this.

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.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall (khall) 2014-05-09 13:36:36 UTC
Created attachment 28134 [details] [review]
[PASSED QA] Bug 12214: (follow-up) correct POD of C4::Reports::Guided::execute_query()

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall (khall) 2014-05-09 13:36:38 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall (khall) 2014-05-09 13:38:52 UTC
Created attachment 28136 [details] [review]
[PASSED QA] Bug 12214 [QA Followup] - Clean up reports-toolbar.inc, show Edit link when SQL has errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Galen Charlton 2014-05-09 14:50:15 UTC
Pushed to master.  Thanks, Pasi!