From a6960bf097b9a72d7022ca5a0544cffd2fa901b4 Mon Sep 17 00:00:00 2001 From: Casey Conlin Date: Tue, 14 Apr 2026 22:53:52 +0000 Subject: [PATCH] Bug 42359: Fix Guided.t update_sql test input The test was feeding update_sql object field names instead of the parameter names it actually expects. This let savedsql get cleared during the update. The test was updated to pass the expected inputs so it still checks cache_expiry without creating the warning in the delete log path. Test plan: 1. Confirm the issue by enabling the ReportsLog preference in Koha UI andin ktd shell running prove t/db_dependent/Reports/Guided.t 2. Apply the patch. 3. Run the tests again with prove t/db_dependent/Reports/Guided.t 4. The tests should pass. 5. Disable the preference and run again. 6. Tests should pass. 7. Sign off if steps above check out. Signed-off-by: Andrew Fuerste Henry Signed-off-by: Lucas Gass (cherry picked from commit d09c65d047f8563b507d2115a4d48da7e4e43c1d) Signed-off-by: Jacob O'Mara Signed-off-by: Wainui Witika-Park --- t/db_dependent/Reports/Guided.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Reports/Guided.t b/t/db_dependent/Reports/Guided.t index 1439d23392..d09fcc7311 100755 --- a/t/db_dependent/Reports/Guided.t +++ b/t/db_dependent/Reports/Guided.t @@ -253,7 +253,15 @@ subtest 'get_saved_reports' => sub { my $r1 = Koha::Reports->find( $report_ids[0] ); $r1 = update_sql( $r1->id, - { %{ $r1->unblessed }, borrowernumber => $r1->borrowernumber, name => 'Just another report' } + { + sql => $r1->savedsql, + name => 'Just another report', + notes => $r1->notes, + group => $r1->report_group, + subgroup => $r1->report_subgroup, + cache_expiry => $r1->cache_expiry, + public => $r1->public, + } ); is( $r1->cache_expiry, 300, 'cache_expiry has the correct default value, from DBMS' );