Bugzilla – Attachment 19375 Details for
Bug 10462
Some optimizations in Z3950 search paving the way for enhancements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10462: Followup for showing multiple ISBNs in Z3950 response
Bug-10462-Followup-for-showing-multiple-ISBNs-in-Z.patch (text/plain), 2.68 KB, created by
Jonathan Druart
on 2013-07-03 14:34:32 UTC
(
hide
)
Description:
Bug 10462: Followup for showing multiple ISBNs in Z3950 response
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-07-03 14:34:32 UTC
Size:
2.68 KB
patch
obsolete
>From 533632e484606ba3825b498b5b9195ea5fc2a91e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 3 Jul 2013 14:26:56 +0200 >Subject: [PATCH] Bug 10462: Followup for showing multiple ISBNs in Z3950 > response > >As Jonathan correctly noted, the new Z3950 response only showed one isbn >although more isbn numbers could be in the record and would be imported. >To resolve this display problem, I traverse them all now in the updated >routine _isbn_show. There is no change in the imported records. >Note that before this patch TransformMarcToKoha did put all isbn numbers in >one field, separated by pipes (for display only). This behavior is restored >now. The three regexes on the individual isbn numbers now seem to be >overkill, but I left them there for completeness. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested this on a fresh French install under UNIMARC with BNF server. >Tested it too for MARC21. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Breeding.pm | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 7859f46..b24b0c7 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -424,7 +424,7 @@ sub _handle_one_result { > sub _add_rowdata { > my ($rowref, $marcrecord)=@_; > if(C4::Context->preference("marcflavour") ne 'UNIMARC') { #MARC21, NORMARC >- $rowref->{isbn} = _isbn_cleanup($marcrecord->subfield('020','a')||''); >+ $rowref->{isbn}= _isbn_show($marcrecord, '020'); > $rowref->{title}= $marcrecord->subfield('245','a')||''; > $rowref->{author}= $marcrecord->subfield('100','a')||''; > $rowref->{date}= $marcrecord->subfield('260','c')||''; >@@ -432,7 +432,7 @@ sub _add_rowdata { > $rowref->{lccn}= $marcrecord->subfield('050','a')||''; > } > else { #UNIMARC >- $rowref->{isbn}= _isbn_cleanup($marcrecord->subfield('010','a')||''); >+ $rowref->{isbn}= _isbn_show($marcrecord, '010'); > $rowref->{title}= $marcrecord->subfield('200','a')||''; > $rowref->{author}= $marcrecord->subfield('200','f')||''; > $rowref->{date}= $marcrecord->subfield('210','d')||''; >@@ -442,11 +442,16 @@ sub _add_rowdata { > return $rowref; > } > >-sub _isbn_cleanup { >- my $isbn= shift; >- $isbn=~ s/ |-|\.//g; >- $isbn=~ s/\|/ \| /g; >- $isbn=~ s/\(/ \(/g; >+sub _isbn_show { >+ my ($record, $fieldno)= @_; #both marc21 and unimarc possible >+ my $isbn= ''; >+ foreach my $f ( $record->field($fieldno) ) { >+ my $a= $f->subfield('a'); >+ $a =~ s/ |-|\.//g; >+ $a =~ s/\|/ \| /g; >+ $a =~ s/\(/ \(/g; >+ $isbn= $isbn? ($isbn.' | '. $a): $a; >+ } > return $isbn; > } > >-- >1.7.10.4
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 10462
:
18939
|
18983
|
19366
|
19374
| 19375 |
19926
|
19928