Bugzilla – Attachment 19928 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: QA Followup to resolve LCCN mixup and remove hardcoded marc tags
Bug-10462-QA-Followup-to-resolve-LCCN-mixup-and-re.patch (text/plain), 3.85 KB, created by
Marcel de Rooy
on 2013-07-24 14:52:11 UTC
(
hide
)
Description:
Bug 10462: QA Followup to resolve LCCN mixup and remove hardcoded marc tags
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-07-24 14:52:11 UTC
Size:
3.85 KB
patch
obsolete
>From 5935dd01b3a88c39e9d6d3d82085580364460588 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 24 Jul 2013 16:14:46 +0200 >Subject: [PATCH] Bug 10462: QA Followup to resolve LCCN mixup and remove > hardcoded marc tags >Content-Type: text/plain; charset=utf-8 > >This patch corrects the mixup for LC call number and control number. > >Further, as suggested by Galen, it would be better to not introduce hardcoded >tags in the Z3950Search subs in Breeding.pm. >This patch resolves that by calling TransformMarcToKohaOneField. >Note that this only involves changes to _addrowdata and _isbn_show. These >subs are only used in building the displayed results table. > >Additionally, for French UNIMARC installs publicationyear is used to fill >the Date column (copyrightdate is not used in those installs). The edition >statement is only used in unimarc_lecture_pub not in unimarc_complet. > >Test plan: >Do some Z3950 searches and look for values in all result columns. >For MARC21 on LOC (and/or others): > Look for isbn 9780415964845 (check LCCN). > Look for author Rowling. >For UNIMARC on BNF2 (and/or others): > On BNF2 look for isbn 2070518426: result contains date and multiple isbn's. > Look for title: Guide des candidats aux emplois de commissaire de police. > Third result show edition statement (if you use 205$a with pub install). > Note that there are no results with LCCN here (just as before). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested for MARC21 and UNIMARC (French lecture_pub install). >--- > C4/Breeding.pm | 49 ++++++++++++++++++++++--------------------------- > 1 files changed, 22 insertions(+), 27 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index b24b0c7..55069db 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -422,36 +422,31 @@ sub _handle_one_result { > } > > sub _add_rowdata { >- my ($rowref, $marcrecord)=@_; >- if(C4::Context->preference("marcflavour") ne 'UNIMARC') { #MARC21, NORMARC >- $rowref->{isbn}= _isbn_show($marcrecord, '020'); >- $rowref->{title}= $marcrecord->subfield('245','a')||''; >- $rowref->{author}= $marcrecord->subfield('100','a')||''; >- $rowref->{date}= $marcrecord->subfield('260','c')||''; >- $rowref->{edition}= $marcrecord->subfield('250','a')||''; >- $rowref->{lccn}= $marcrecord->subfield('050','a')||''; >- } >- else { #UNIMARC >- $rowref->{isbn}= _isbn_show($marcrecord, '010'); >- $rowref->{title}= $marcrecord->subfield('200','a')||''; >- $rowref->{author}= $marcrecord->subfield('200','f')||''; >- $rowref->{date}= $marcrecord->subfield('210','d')||''; >- $rowref->{edition}= $marcrecord->subfield('205','a')||''; >- $rowref->{lccn}= ''; >+ my ($row, $record)=@_; >+ my %fetch= ( >+ title => 'biblio.title', >+ author => 'biblio.author', >+ isbn =>'biblioitems.isbn', >+ lccn =>'biblioitems.lccn', #LC control number (not call number) >+ edition =>'biblioitems.editionstatement', >+ date => 'biblio.copyrightdate', #MARC21 >+ date2 => 'biblioitems.publicationyear', #UNIMARC >+ ); >+ foreach my $k (keys %fetch) { >+ my ($t, $f)= split '\.', $fetch{$k}; >+ $row= C4::Biblio::TransformMarcToKohaOneField($t, $f, $record, $row); >+ $row->{$k}= $row->{$f} if $k ne $f; > } >- return $rowref; >+ $row->{date}//= $row->{date2}; >+ $row->{isbn}=_isbn_replace($row->{isbn}); >+ return $row; > } > >-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; >- } >+sub _isbn_replace { >+ my ($isbn)= @_; >+ $isbn =~ s/ |-|\.//g; >+ $isbn =~ s/\|/ \| /g; >+ $isbn =~ s/\(/ \(/g; > return $isbn; > } > >-- >1.7.7.6
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