From d041201f5c4661097c0e8066c8b852864c2b2750 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Tue, 17 Jan 2023 12:18:00 -0500 Subject: [PATCH] =?UTF-8?q?Bug=C2=A032656:=20Script=20delete=5Frecords=5Fv?= =?UTF-8?q?ia=5Fleader.pl=20no=20longer=20deletes=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug 29788 inadvertantly replaced a call to safe_delete() with safe_to_delete() such that any time the script should delete an item it only checks to see if the item is delectable, after which deletion of the record fails because the items were not deleted. Test Plan: 1) Mark a record with items to be deleted via the record leader 2) Run delete_records_via_leader.pl -i -b -v 3) Note the script says it is deleting the items but then the record deletion fails. Note the items remain in the items table of the database. 4) Apply this patch 5) Repeat step 2 6) This time the items and record should be deleted! --- misc/cronjobs/delete_records_via_leader.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl index 030b1475dd..03a0882ba5 100755 --- a/misc/cronjobs/delete_records_via_leader.pl +++ b/misc/cronjobs/delete_records_via_leader.pl @@ -99,7 +99,7 @@ foreach my $m (@metadatas) { say "TEST MODE: ERROR DELETING ITEM $itemnumber: $error"; } } else { - my $deleted = $item->safe_to_delete; + my $deleted = $item->safe_delete; if ( $deleted ) { say "DELETED ITEM $itemnumber" if $verbose; $deleted_items_count++; -- 2.30.2