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 <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d09c65d047)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Casey Conlin 2026-04-14 22:53:52 +00:00 committed by Wainui Witika-Park
parent 8d6bcefd46
commit a6960bf097
No known key found for this signature in database
GPG Key ID: 2D0A6AB5DAF1B78D
1 changed files with 9 additions and 1 deletions

View File

@ -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' );