Bugzilla – Attachment 22291 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: Remove use of MARC::File::USMARC from AuthoritiesMarc.pm
Bug-11096-Remove-use-of-MARCFileUSMARC-from-Author.patch (text/plain), 3.56 KB, created by
Tomás Cohen Arazi
on 2013-10-22 17:44:13 UTC
(
hide
)
Description:
Bug 11096: Remove use of MARC::File::USMARC from AuthoritiesMarc.pm
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2013-10-22 17:44:13 UTC
Size:
3.56 KB
patch
obsolete
>From cbb130f72115a302829813a8e3337feb5156c305 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 21 Oct 2013 16:17:57 -0700 >Subject: [PATCH] Bug 11096: Remove use of MARC::File::USMARC from > AuthoritiesMarc.pm > >Thats it. > >To test: >- Apply the patch >- Test authorities search in all its flavours (staff and opac). >- Use the dontmerge syspref to try the AuthoritiesMarc::merge function. > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > C4/AuthoritiesMarc.pm | 33 +++++++++++++++++++-------------- > 1 file changed, 19 insertions(+), 14 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 7443f36..cfb2bf2 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -266,10 +266,11 @@ sub SearchAuthorities { > > ##Here we have to extract MARC record and $authid from ZEBRA AUTHORITIES > my $rec=$oAResult->record($counter); >- my $marcdata=$rec->raw(); >- my $authrecord; > my $separator=C4::Context->preference('authoritysep'); >- $authrecord = MARC::File::USMARC::decode($marcdata); >+ my $authrecord = MARC::Record->new_from_xml( >+ $rec->raw(), >+ 'UTF-8' >+ ); > my $authid=$authrecord->field('001')->data(); > my %newline; > $newline{authid} = $authid; >@@ -847,15 +848,17 @@ sub FindDuplicateAuthority { > my $query='at:'.$authtypecode.' '; > my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); > if ($record->field($auth_tag_to_report)) { >- foreach ($record->field($auth_tag_to_report)->subfields()) { >- $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); >- } >+ foreach ($record->field($auth_tag_to_report)->subfields()) { >+ $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); >+ } > } > my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, 0, 1, [ "authorityserver" ] ); > # there is at least 1 result => return the 1st one > if (!defined $error && @{$results} ) { >- my $marcrecord = MARC::File::USMARC::decode($results->[0]); >- return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); >+ my $marcrecord = MARC::Record->new_from_xml( >+ $results->[0] >+ ); >+ return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); > } > # no result, returns nothing > return; >@@ -1452,13 +1455,15 @@ sub merge { > } > my $z=0; > while ( $z<$count ) { >- my $rec; >- $rec=$oResult->record($z); >- my $marcdata = $rec->raw(); >- my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); >+ my $marcrecordzebra= MARC::Record->new_from_xml( >+ $oResult->record($z)->raw(), >+ 'UTF-8' >+ ); > my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); >- my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); >- my $marcrecorddb=GetMarcBiblio($i); >+ my $i = ($biblionumbertagfield < 10) >+ ? $marcrecordzebra->field( $biblionumbertagfield )->data >+ : $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); >+ my $marcrecorddb = GetMarcBiblio($i); > push @reccache, $marcrecorddb; > $z++; > } >-- >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