Bugzilla – Attachment 23337 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]
Bug 11096: wrap MARC::Record->new_from_xml call with eval
Bug-11096-wrap-MARCRecord-newfromxml-call-with-eva.patch (text/plain), 2.30 KB, created by
Kyle M Hall
on 2013-12-06 12:26:06 UTC
(
hide
)
Description:
Bug 11096: wrap MARC::Record->new_from_xml call with eval
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2013-12-06 12:26:06 UTC
Size:
2.30 KB
patch
obsolete
>From 5eab71dd61727b269115a2919f94513d72bb0abe 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] 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 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index c082dc0..732838c 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.7.2.5
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