Bugzilla – Attachment 24030 Details for
Bug 11096
Koha cannot retrieve big records from Zebra
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 11096: wrap MARC::Record->new_from_xml call with eval
SIGNED-OFF-Bug-11096-wrap-MARCRecord-newfromxml-ca.patch (text/plain), 2.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-01-08 18:53:08 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 11096: wrap MARC::Record->new_from_xml call with eval
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-01-08 18:53:08 UTC
Size:
2.31 KB
patch
obsolete
>From b99b8e3829f925bfba1b1cb5b63487a86b2d390f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 19 Nov 2013 10:48:56 -0300 >Subject: [PATCH] [SIGNED OFF] Bug 11096: wrap MARC::Record->new_from_xml call > with eval > >Catch situations where MARC::Record would croak for bad-formed records. > >To test: >- Run prove t/db_dependent/Search.t >- It will fail at test 65 [1] >- Apply the patch, it will warn for some failing records, > but the tests will run smoothly. > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba > >[1] a record that cannot be parsed by MARC::Record is simply skipped (bug 10684) > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> > >- All tests and QA script pass after applying the patch. >- Verfied that sample record is not searchable before applying > patch, but can be searched without problems after applying it. >- Tested authority searching still workds as expected. >- Tested bilbiographic searching still works as expected. > - Simple search, also truncated search terms > - Facetting > - Advanced search, also itemtype and pubyear limits >- Tested dontmerge preference, editing a linked authority and > confirming the change is made to the linked records as well. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Search.pm | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 9311722..11f0ba4 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -506,10 +506,17 @@ sub getRecords { > for my $facet (@$facets) { > for ( my $j = 0 ; $j < $jmax ; $j++ ) { > >- my $marc_record = MARC::Record->new_from_xml( >+ my $marc_record = eval { MARC::Record->new_from_xml( > $results[ $i - 1 ]->record($j)->raw(), > 'UTF-8' >- ); >+ ); }; >+ >+ if ( $@ ) { >+ warn "ERROR DECODING RECORD - $@: " . >+ $results[ $i - 1 ]->record($j)->raw(); >+ next; >+ } >+ > my @used_datas = (); > > foreach my $tag ( @{ $facet->{tags} } ) { >-- >1.8.3.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 11096
:
22291
|
22292
|
22821
|
22845
|
22846
|
22997
|
23030
|
23033
|
23234
|
23235
|
23236
|
23237
|
23336
|
23337
|
23366
|
24019
|
24020
|
24029
|
24030
|
24031
|
24172
|
24186
|
24187
|
24188
|
24490
|
24491
|
24492
|
24580
|
24602
|
24603
|
24604
|
24605
|
24607
|
24731
|
24732
|
24874
|
24894
|
24895
|
24896
|
24901
|
25282
|
25634
|
25635
|
25636