Summary: | Can't edit reports if not using cache | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Reports | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Kyle M Hall (khall) <kyle> |
Severity: | normal | ||
Priority: | P5 - low | CC: | 1joynelson, hayleypelham, jonathan.druart, kyle, lucas, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
20.05.00, 19.11.05, 19.05.10
|
Circulation function: | |
Bug Depends on: | |||
Bug Blocks: | 25000 | ||
Attachments: |
Bug 24614: Add tests
Bug 24614: Use Koha::Reports from save_report and update_sql Bug 24614: Add tests Bug 24614: Use Koha::Reports from save_report and update_sql Bug 24614: Add tests Bug 24614: Use Koha::Reports from save_report and update_sql Bug 24614: Fix Reports/Guided.t |
Description
Nick Clemens (kidclamp)
2020-02-07 19:42:58 UTC
Created attachment 98714 [details] [review] Bug 24614: Add tests Created attachment 98715 [details] [review] 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. Created attachment 101700 [details] [review] Bug 24614: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 101701 [details] [review] 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> Does the trick, Signing off. Created attachment 101764 [details] [review] Bug 24614: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 101765 [details] [review] 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> Nice work everyone! Pushed to master for 20.05 Created attachment 102013 [details] [review] Bug 24614: Fix Reports/Guided.t DBD::mysql::st execute failed: Column 'public' cannot be null [for Statement "UPDATE `saved_sql` SET `last_modified` = ?, `notes` = ?, `public` = ?, `report_group` = ?, `report_name` = ?, `report_subgroup` = ?, `savedsql` = ? WHERE ( `id` = ? )" with ParamValues: 0='2020-03-27T16:03:04', 1=undef, 2=undef, 3=undef, 4='Just another report', 5=undef, 6=undef, 7=25] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. # Looks like you planned 17 tests but ran 6. update_sql expect all the paramters to be set, otherwise it will be nulled. The best way to fix it is at test level. There is only 1 occurrence in controller/module, and it sends all the parameters. That is the correct way to do and will make things easier when we will removed them to use Koha::Reports directly backported to 19.11.x for 19.11.05 backported to 19.05.x for 19.05.10 Normal patch will not be backported to 18.11.x series |