Bugzilla – Attachment 101370 Details for
Bug 24324
delete_records_via_leader.pl cron error with item deletion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24324: Resolve error with delete_records_via_leader.pl
Bug-24324-Resolve-error-with-deleterecordsvialeade.patch (text/plain), 2.19 KB, created by
Katrin Fischer
on 2020-03-22 13:44:08 UTC
(
hide
)
Description:
Bug 24324: Resolve error with delete_records_via_leader.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-03-22 13:44:08 UTC
Size:
2.19 KB
patch
obsolete
>From 0991b9bc67191820a396c30b657a808152703230 Mon Sep 17 00:00:00 2001 >From: Liz Rea <wizzyrea@gmail.com> >Date: Fri, 3 Jan 2020 21:18:27 +0000 >Subject: [PATCH] Bug 24324: Resolve error with delete_records_via_leader.pl > >To test: > >Have a record with the 000 position 5 set to "deleted" (record status) >Use koha-shell to run the job with the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -i -v >* items and the record should be deleted >Mark another record with the 000 position 5 set to deleted (record status) >Use koha-shell to run the job without the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -v >* if the record had items, it will not be deleted >* if the record did not have items, it will be deleted. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Works ok. Fixed tab char in line 98, no more errors. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > misc/cronjobs/delete_records_via_leader.pl | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl >index e65fbbf11d..67dfdfda98 100755 >--- a/misc/cronjobs/delete_records_via_leader.pl >+++ b/misc/cronjobs/delete_records_via_leader.pl >@@ -39,6 +39,7 @@ use C4::Items; > use Koha::Database; > use Koha::Biblios; > use Koha::Biblio::Metadatas; >+use Koha::Items; > > my $delete_items; > my $confirm; >@@ -86,7 +87,6 @@ my $total_records_count = @metadatas; > my $deleted_records_count = 0; > my $total_items_count = 0; > my $deleted_items_count = 0; >- > foreach my $m (@metadatas) { > my $biblionumber = $m->get_column('biblionumber'); > >@@ -95,10 +95,9 @@ foreach my $m (@metadatas) { > if ($delete_items) { > my $deleted_count = 0; > my $biblio = Koha::Biblios->find( $biblionumber ); >- my @items = $biblio ? $biblio->items : (); >+ my @items = Koha::Items->search( { biblionumber => $biblionumber } ); > foreach my $item ( @items ) { >- my $itemnumber = $item->itemnumber(); >- >+ my $itemnumber = $item->itemnumber; > my $error = $test ? "Test mode enabled" : DelItemCheck( $biblionumber, $itemnumber ); > $error = undef if $error eq '1'; > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24324
:
96807
|
96808
|
101337
| 101370