Bugzilla – Attachment 45499 Details for
Bug 14363
OAI-PMH should handle records without marcxml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14363: OAI-PMH: Handle records without marcxml
Bug-14363-OAI-PMH-Handle-records-without-marcxml.patch (text/plain), 1.46 KB, created by
Jonathan Druart
on 2015-12-08 15:34:57 UTC
(
hide
)
Description:
Bug 14363: OAI-PMH: Handle records without marcxml
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-08 15:34:57 UTC
Size:
1.46 KB
patch
obsolete
>From f1b1810d56670d74288831fef9872fec5025b58f Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 1 Sep 2015 09:46:35 +0200 >Subject: [PATCH] Bug 14363: OAI-PMH: Handle records without marcxml >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: > >1/ git checkout 3.18.x >2/ GET http://OPAC/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml >3/ Take the first biblionumber from the results ($biblionumber) >4/ mysql> update biblioitems set marcxml=null where biblionumber=$biblionumber >5/ Repeat step 2 => XML error >6/ Apply patch >7/ Repeat step 2 => no errors > >Signed-off-by: Frédéric Demians <f.demians@tamil.fr> > Works on 3.20.x > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Fix works for 3.18.x and 3.20.x >3.22 is not impacted >--- > opac/oai.pl | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/opac/oai.pl b/opac/oai.pl >index 7eb0f6b..68668c7 100755 >--- a/opac/oai.pl >+++ b/opac/oai.pl >@@ -240,7 +240,15 @@ sub new { > } > > my $parser = XML::LibXML->new(); >- my $record_dom = $parser->parse_string( $marcxml ); >+ my $record_dom; >+ eval { >+ $record_dom = $parser->parse_string( $marcxml ); >+ }; >+ if ($@) { >+ warn "OAI-PMH: No marcxml for record " . $args{identifier}; >+ return $self; >+ } >+ > my $format = $args{metadataPrefix}; > if ( $format ne 'marcxml' ) { > my %args = ( >-- >2.1.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 14363
:
42135
|
45489
| 45499