Bugzilla – Attachment 114575 Details for
Bug 26171
Show biblionumber in Koha::Exceptions::Metadata::Invalid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Bug-26171-Show-biblionumber-in-KohaExceptionsMetad.patch (text/plain), 2.76 KB, created by
Nick Clemens (kidclamp)
on 2020-12-21 19:25:33 UTC
(
hide
)
Description:
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-12-21 19:25:33 UTC
Size:
2.76 KB
patch
obsolete
>From a6078f6bb21264afe6d51ef7eda0a8fc7ede17ae Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 7 Aug 2020 10:05:52 +0200 >Subject: [PATCH] Bug 26171: Show biblionumber in > Koha::Exceptions::Metadata::Invalid > >Bug 23846 added a check for invalid MARCXML in search_for_data_inconsistencies.pl. >But the error message does not show the biblionumber of invalid biblio record. > >Test plan: >1) Import a bibliographic record with invalid XML, you can add non printable characters, like 0x1F (CTRL-V 1F with vim) >2) Run misc/maintenance/search_for_data_inconsistencies.pl >3) Check you see correct biblionumber in error message : >Invalid data, cannot decode object (id=xxx, biblionumber=yyy, format=marcxml, schema=zzz, decoding_error=... > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Biblio/Metadata.pm | 7 ++++--- > Koha/Exceptions/Metadata.pm | 6 +++--- > 2 files changed, 7 insertions(+), 6 deletions(-) > >diff --git a/Koha/Biblio/Metadata.pm b/Koha/Biblio/Metadata.pm >index b43a04bdb2..f55b766a4b 100644 >--- a/Koha/Biblio/Metadata.pm >+++ b/Koha/Biblio/Metadata.pm >@@ -72,9 +72,10 @@ sub record { > chomp $marcxml_error; > unless ($record) { > Koha::Exceptions::Metadata::Invalid->throw( >- id => $self->id, >- format => $self->format, >- schema => $self->schema, >+ id => $self->id, >+ biblionumber => $self->biblionumber, >+ format => $self->format, >+ schema => $self->schema, > decoding_error => $marcxml_error, > ); > } >diff --git a/Koha/Exceptions/Metadata.pm b/Koha/Exceptions/Metadata.pm >index be604b18d3..78dadae348 100644 >--- a/Koha/Exceptions/Metadata.pm >+++ b/Koha/Exceptions/Metadata.pm >@@ -25,7 +25,7 @@ use Exception::Class ( > 'Koha::Exceptions::Metadata::Invalid' => { > isa => 'Koha::Exceptions::Metadata', > description => 'Invalid data', >- fields => ['id','format','schema', 'decoding_error'] >+ fields => ['id', 'biblionumber', 'format', 'schema', 'decoding_error'] > } > ); > >@@ -36,8 +36,8 @@ sub full_message { > > unless ($msg) { > if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) { >- $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s, decoding_error='%s')", >- $self->id, $self->format, $self->schema, $self->decoding_error ); >+ $msg = sprintf( "Invalid data, cannot decode object (id=%s, biblionumber=%s, format=%s, schema=%s, decoding_error='%s')", >+ $self->id, $self->biblionumber, $self->format, $self->schema, $self->decoding_error ); > } > } > >-- >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 26171
:
107941
|
107944
|
114050
|
114051
| 114575 |
114576
|
114577