Bug 13992 - Software error in reports if field or table does not exist
Summary: Software error in reports if field or table does not exist
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 08:14 UTC by Marc Véron
Modified: 2015-12-03 22:11 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13992 - Software error in reports if field or table does not exist (1.88 KB, patch)
2015-04-14 08:33 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED OFF] Bug 13992 - Software error in reports if field or table does not exist (1.94 KB, patch)
2015-04-15 18:20 UTC, Nick Clemens
Details | Diff | Splinter Review
[PASSED QA] Bug 13992 - Software error in reports if field or table does not exist (2.00 KB, patch)
2015-04-15 22:05 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2015-04-14 08:14:09 UTC
To reproduce:

- Go to Home > Reports Guided reports wizard
- Create report from SQL
- Enter something like: select holdrio from borrowers
- Save SQL
- run report

Result:
Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/reports/guided_reports.pl line 932.
expected: graceful error message

- Change sql to something like: select id from holdrio;
- Save SQL
- Run report

Result:
Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/reports/guided_reports.pl line 932.
expected:  graceful error message

- Change sql to something like: pling from plong
- Save SQL
Result (after saving): Message "The database returned the following error: 1"
Expected: Meaningful message "The database returned the following error: No SELECT" (similar to forbidden statements as UPDATE)
Comment 1 Marc Véron 2015-04-14 08:33:53 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens 2015-04-15 18:20:39 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-04-15 22:05:33 UTC
Created attachment 37935 [details] [review]
[PASSED QA] Bug 13992 - Software error in reports if field or table does not exist

To reproduce:

- Go to Home > Reports Guided reports wizard
- Create report from SQL
- Enter something like: select holdrio from borrowers
- Save SQL
- run report

Result:
Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/reports/guided_reports.pl line 932.
expected: graceful error message

- Change sql to something like: select id from holdrio;
- Save SQL
- Run report

Result:
Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/reports/guided_reports.pl line 932.
expected:  graceful error message

- Change sql to something like: pling from plong
- Save SQL
Result (after saving): Message "The database returned the following error: 1"
Expected: Meaningful message "The database returned the following error: No SELECT" (similar to forbidden statements as UPDATE)

Test plan:
- Apply patch
- Try to reproduce issues above. They should be resolved.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Tomás Cohen Arazi 2015-04-24 13:13:48 UTC
Patch pushed to master.

Thanks Marc!
Comment 5 Chris Cormack 2015-05-17 03:47:58 UTC
Doesn't apply on 3.18.x please rebase if you think it is needed