]> git.koha-community.org Git - koha.git/commit
Bug 24695: Improve SQL report validation
authorPasi Kallinen <pasi.kallinen@koha-suomi.fi>
Thu, 20 Feb 2020 09:31:08 +0000 (11:31 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Apr 2021 13:27:50 +0000 (15:27 +0200)
commitba5be802e045de49654a5f3f4e9d0e62b1489ae4
treee69689031746f97b277c240fec83760ee23373a7
parent925eecd6bd07dbe3026c6f1172da6848aaf09e2c
Bug 24695: Improve SQL report validation

The saved SQL report code validates the SQL in multiple places:
when saving, when updating, and when executing the query.
Move the validation code into Koha::Reports, and write tests for it.

Test plan:
1) Apply patch
2) Create a new valid SQL report, save it (success)
3) Create a new illegal SQL report, try to save (fails)
4) Update already saved SQL report by adding one of
   the forbidden words, eg. delete or drop (saving will fail)
5) Edit a save_sql in the database, changing it to eg.
   "drop borrowers", and try to execute it (fails)
6) Prove t/db_dependent/Koha/Reports.t

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no qa errors.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 24695: (QA follow-up) Fix number of tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Reports/Guided.pm
Koha/Reports.pm
reports/guided_reports.pl
t/db_dependent/Koha/Reports.t