Bugzilla – Attachment 164269 Details for
Bug 36473
updatetotalissues.pl should not die on a bad record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36473: Handle Invalid Metadata Exceptions in totalissues.pl
Bug-36473-Handle-Invalid-Metadata-Exceptions-in-to.patch (text/plain), 1.40 KB, created by
Laura Escamilla
on 2024-04-02 13:45:13 UTC
(
hide
)
Description:
Bug 36473: Handle Invalid Metadata Exceptions in totalissues.pl
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-04-02 13:45:13 UTC
Size:
1.40 KB
patch
obsolete
>From 9df38891668201fa5ba129fd91a392100c16f11b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 1 Apr 2024 14:32:08 +0000 >Subject: [PATCH] Bug 36473: Handle Invalid Metadata Exceptions in > totalissues.pl > >This patch wraps the call for record in an eval, and catches any invalid metadata >exceptions, letting the warning show, but allowing the script to continue >To test: >1 - In default KTD record 369 has problems, otherwise you need to break a record >2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v >3 - It dies at record 369 (or the one you broke) >4 - Apply patch >5 - Run again >6 - It succeeds, but skips the bad record >--- > C4/Biblio.pm | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 0fd56741d4..3924430b77 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -3057,9 +3057,12 @@ sub UpdateTotalIssues { > return; > } > >- my $record = $biblio->metadata->record; >- unless ($record) { >- carp "UpdateTotalIssues could not get biblio record"; >+ my $record; >+ eval { $record = $biblio->metadata->record }; >+ if ($@) { >+ my $exception = $@; >+ $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); >+ warn "UpdateTotalIssues could not get biblio record"; > return; > } > my $biblioitem = $biblio->biblioitem; >-- >2.30.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 36473
:
164192
|
164247
|
164269
|
164270
|
164271
|
164289
|
164290
|
164458
|
164459
|
164805
|
164806
|
165039
|
165077
|
165078
|
165079