From 9921b88bf3ee24ff5e0a6a735e315fa59412c7e3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 29 Dec 2016 18:15:40 +0000 Subject: [PATCH] Bug 17196 - (QA Followup) Use items from Koha::Biblio Signed-off-by: Nick Clemens Signed-off-by: Marcel de Rooy Amended: Using items from Koha::Biblio seems better :) Signed-off-by: Kyle M Hall --- misc/cronjobs/delete_records_via_leader.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl index baba5dc38b..b4d87810be 100755 --- a/misc/cronjobs/delete_records_via_leader.pl +++ b/misc/cronjobs/delete_records_via_leader.pl @@ -36,7 +36,7 @@ use Getopt::Long; use C4::Biblio; use C4::Items; use Koha::Database; -use Koha::Biblioitems; +use Koha::Biblios; use Koha::Biblio::Metadatas; my $delete_items; @@ -86,8 +86,9 @@ foreach my $m (@metadatas) { if ($delete_items) { my $deleted_count = 0; - my $biblioitem = Koha::Biblioitems->find( $biblionumber ); - foreach my $item ( $biblioitem->items() ) { + my $biblio = Koha::Biblios->find( $biblionumber ); + my @items = $biblio ? $biblio->items : (); + foreach my $item ( @items ) { my $itemnumber = $item->itemnumber(); my $error = $test ? "Test mode enabled" : DelItemCheck( $biblionumber, $itemnumber ); -- 2.39.5