From 144372e72ed59f9ded5db00b9f4f9e38bfa0ada9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 7 Jun 2022 14:11:06 +0200 Subject: [PATCH] Bug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves Silly mistake, 'delete if verbose' must be 'delete if confirm' Test plan: Try the cleanup_database.pl script to delete transfers and old issues. Using --transfers --old-reserves and the --confirm flag the entries must be removed Signed-off-by: Fridolin Somers Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit a6166405c7d7886466a8d1264c98970b4973f77f) Signed-off-by: Lucas Gass (cherry picked from commit b503c186e4ca8012b24441e746045c7439c44b97) Signed-off-by: Arthur Suzuki --- misc/cronjobs/cleanup_database.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index abc7d180da..19e97d51ec 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -616,7 +616,7 @@ if ($pOldReserves) { print "Purging old reserves older than $pOldReserves days.\n" if $verbose; my $old_reserves = Koha::Old::Holds->filter_by_last_update( { days => $pOldReserves } ); my $count = $old_reserves->count; - $old_reserves->delete if $verbose; + $old_reserves->delete if $confirm; if ($verbose) { say $confirm ? sprintf "Done with purging %d old reserves.", $count @@ -633,7 +633,7 @@ if ($pTransfers) { } ); my $count = $transfers->count; - $transfers->delete if $verbose; + $transfers->delete if $confirm; if ($verbose) { say $confirm ? sprintf "Done with purging %d transfers.", $count -- 2.39.5