Bugzilla – Attachment 189824 Details for
Bug 30255
Allow skipping "list" step for record batch modification/deletion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30255: Improve handling of non-existant record ids in modification/deletion background jobs
Bug-30255-Improve-handling-of-non-existant-record-.patch (text/plain), 2.52 KB, created by
David Gustafsson
on 2025-11-21 07:26:19 UTC
(
hide
)
Description:
Bug 30255: Improve handling of non-existant record ids in modification/deletion background jobs
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2025-11-21 07:26:19 UTC
Size:
2.52 KB
patch
obsolete
>From 0ae7f364ffcb85452005e76e6cccd58d97a53993 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Fri, 21 Nov 2025 08:25:48 +0100 >Subject: [PATCH] Bug 30255: Improve handling of non-existant record ids in > modification/deletion background jobs > >--- > Koha/BackgroundJob/BatchDeleteBiblio.pm | 2 ++ > Koha/BackgroundJob/BatchUpdateAuthority.pm | 4 +++- > Koha/BackgroundJob/BatchUpdateBiblio.pm | 2 ++ > 3 files changed, 7 insertions(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJob/BatchDeleteBiblio.pm b/Koha/BackgroundJob/BatchDeleteBiblio.pm >index 3bc7f7336ee..1ce75f4c437 100644 >--- a/Koha/BackgroundJob/BatchDeleteBiblio.pm >+++ b/Koha/BackgroundJob/BatchDeleteBiblio.pm >@@ -72,6 +72,8 @@ RECORD_IDS: for my $record_id ( sort { $a <=> $b } @record_ids ) { > # If yes, nothing to do > my $biblio = Koha::Biblios->find($biblionumber); > >+ next unless $biblio; >+ > # TODO Replace with $biblio->get_issues->count > if ( C4::Biblio::CountItemsIssued($biblionumber) ) { > push @messages, { >diff --git a/Koha/BackgroundJob/BatchUpdateAuthority.pm b/Koha/BackgroundJob/BatchUpdateAuthority.pm >index f19dddca600..ec7128f02c0 100644 >--- a/Koha/BackgroundJob/BatchUpdateAuthority.pm >+++ b/Koha/BackgroundJob/BatchUpdateAuthority.pm >@@ -76,7 +76,9 @@ RECORD_IDS: for my $record_id ( sort { $a <=> $b } @record_ids ) { > my $authid = $record_id; > my $error = eval { > my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid); >- my $record = $authority->record; >+ die("Invalid authid: $authid") unless $authority; >+ >+ my $record = $authority->record; > ModifyRecordWithTemplate( $mmtid, $record ); > ModAuthority( $authid, $record, $authority->authtypecode, { skip_record_index => 1 } ); > }; >diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm >index bbd4a7a5453..3ae601306c4 100644 >--- a/Koha/BackgroundJob/BatchUpdateBiblio.pm >+++ b/Koha/BackgroundJob/BatchUpdateBiblio.pm >@@ -85,6 +85,8 @@ RECORD_IDS: for my $biblionumber ( sort { $a <=> $b } @record_ids ) { > my $error = eval { > my $biblio = Koha::Biblios->find($biblionumber); > my $record = $biblio->metadata->record; >+ die("Invalid biblionumber: $biblionumber") unless $record; >+ > C4::MarcModificationTemplates::ModifyRecordWithTemplate( $mmtid, $record ); > my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); > >-- >2.51.2
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 30255
:
131527
|
151289
|
151382
|
162547
|
162603
|
178175
|
178176
|
179486
|
179487
|
179488
|
189803
|
189804
|
189805
|
189806
|
189824
|
189825
|
189826