Bug 24614: Use Koha::Reports from save_report and update_sql
commit6dde1fa54a7fcf4623adaa2b32f58d5ba5952137
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 11 Feb 2020 16:21:38 +0000 (11 17:21 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 13 Apr 2020 20:39:31 +0000 (13 20:39 +0000)
treec4a9b8a735a7a8369cf9ccff13be496640038dbb
parentb3fa716084bfc8e53f3c470eed368333c7e75b30
Bug 24614: Use Koha::Reports from save_report and update_sql

In order to get the default value defined at DBMS level, we use
Koha::Reports (to inherit from Koha::Object->store) from the 2 add/edit
methods of C4::Reports::Guided.
A second step would be to remove completely those CRUD subroutines and
use directly Koha::Reports instead.

Test plan:
1. Add and edit some reports
2. Disable memcached, create a report, edit it
=> Should not crash
3. Make sure the tests make sense and that they pass after the second
patch.

The error was:
DBD::mysql::db do failed: Column 'cache_expiry' cannot be null [for
Statement "UPDATE saved_sql SET savedsql = ?, last_modified = now(),
report_name = ?, report_group = ?, report_subgroup = ?, notes = ?,
cache_expiry = ?, public = ? WHERE id = ? "] at
/kohadevbox/koha/C4/Reports/Guided.pm line 633.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 0a6c345703d46f4da4714dd5fa9ae673fab94ec6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Reports/Guided.pm