Bug 13992: Software error in reports if field or table does not exist
authorMarc Véron <veron@veron.ch>
Tue, 14 Apr 2015 08:28:03 +0000 (10:28 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 24 Apr 2015 13:07:45 +0000 (10:07 -0300)
commit4177d3ecd3d5c6620b5bcc09d69c17d2c79997ff
treeb5018ae379c8e06351ccb3517c8f1f8c3df4700d
parent856861b47ee7e0658f790391fbf22af38e48616b
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
reports/guided_reports.pl