Bugzilla – Attachment 91948 Details for
Bug 23425
Search explodes with "invalid data, cannot decode object"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23425: Display the MARCXML error in the Metadata::Invalid exception message
Bug-23425-Display-the-MARCXML-error-in-the-Metadat.patch (text/plain), 2.07 KB, created by
Jonathan Druart
on 2019-08-04 15:48:19 UTC
(
hide
)
Description:
Bug 23425: Display the MARCXML error in the Metadata::Invalid exception message
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-08-04 15:48:19 UTC
Size:
2.07 KB
patch
obsolete
>From 1532b684431c0258005c1a60f0a8f361e6ec4f5b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 4 Aug 2019 10:47:02 -0500 >Subject: [PATCH] Bug 23425: Display the MARCXML error in the Metadata::Invalid > exception message > >--- > Koha/Biblio/Metadata.pm | 5 ++++- > Koha/Exceptions/Metadata.pm | 6 +++--- > 2 files changed, 7 insertions(+), 4 deletions(-) > >diff --git a/Koha/Biblio/Metadata.pm b/Koha/Biblio/Metadata.pm >index 9da2ec2b49..bbc11d9d87 100644 >--- a/Koha/Biblio/Metadata.pm >+++ b/Koha/Biblio/Metadata.pm >@@ -68,11 +68,14 @@ sub record { > > if ( $self->format eq 'marcxml' ) { > $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); }; >+ my $marcxml_error = $@; >+ chomp $marcxml_error; > unless ($record) { > Koha::Exceptions::Metadata::Invalid->throw( > id => $self->id, > format => $self->format, >- schema => $self->schema >+ schema => $self->schema, >+ marcxml_error => $marcxml_error, > ); > } > } >diff --git a/Koha/Exceptions/Metadata.pm b/Koha/Exceptions/Metadata.pm >index d9f55efd56..887a49e5db 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'] >+ fields => ['id','format','schema', 'marcxml_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)", >- $self->id, $self->format, $self->schema ); >+ $msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s, MARCXML error='%s')", >+ $self->id, $self->format, $self->schema, $self->marcxml_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 23425
:
91948
|
92906
|
92907