Bugzilla – Attachment 31316 Details for
Bug 12788
Refine search displays 4xx fields from authority records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12788: facets calculation should skip 100 if ind1=z
Bug-12788-facets-calculation-should-skip-100-if-in.patch (text/plain), 2.58 KB, created by
David Cook
on 2014-09-02 03:27:04 UTC
(
hide
)
Description:
Bug 12788: facets calculation should skip 100 if ind1=z
Filename:
MIME Type:
Creator:
David Cook
Created:
2014-09-02 03:27:04 UTC
Size:
2.58 KB
patch
obsolete
>From c80cbf856d4a80a587092ce70760776c8b32f5f0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Wed, 20 Aug 2014 00:48:07 -0300 >Subject: [PATCH] Bug 12788: facets calculation should skip 100 if ind1=z > >This patch adds a test for field 100, to skip it on facet calculation >if ind1=z. > >To test: >- Have IncludeSeeFromInSearches set. >- Create a biblio record, when adding an author, create a new authority record > that contains a 400$a field (see from). >- Rebuild zebra db. >- Search for the record making sure the search returns more than one record. >=> FAIL: the facets contain the 'see from' field. >- Run > $ prove -v t/db_dependent/Search.t >=> FAIL: it fails >- Apply the patch >- Run > $ prove -v t/db_dependent/Search.t >=> SUCCESS: it passes >- Re-run the search, notice the 'see from' doesn't show anymore on the facets. >- Sign off :-D > >Edit: minor stylistic change > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba > >Signed-off-by: Nick Clemens <nick@quecheelibrary.org> >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > C4/Search.pm | 11 +++++++---- > 1 files changed, 7 insertions(+), 4 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 9587f7d..39ec294 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -656,7 +656,7 @@ sub getRecords { > C4::Search::_get_facets_data_from_record( $marc_record, $facets, $facets_counter ); > > Internal function that extracts facets information from a MARC::Record object >-and populates $facets_counter for using in getRecords. >+and populates $facets_counter and $facets_info for using in getRecords. > > $facets is expected to be filled with C4::Koha::getFacets output (i.e. the configured > facets for Zebra). >@@ -673,14 +673,17 @@ sub _get_facets_data_from_record { > > foreach my $tag ( @{ $facet->{ tags } } ) { > >- # avoid first line >+ # tag number is the first three digits > my $tag_num = substr( $tag, 0, 3 ); >+ # subfields are the remainder > my $subfield_letters = substr( $tag, 3 ); >- # Removed when as_string fixed >- my @subfields = $subfield_letters =~ /./sg; > > my @fields = $marc_record->field( $tag_num ); > foreach my $field (@fields) { >+ # If $field->indicator(1) eq 'z', it means it is a 'see from' >+ # field introduced because of IncludeSeeFromInSearches, so skip it >+ next if $field->indicator(1) eq 'z'; >+ > my $data = $field->as_string( $subfield_letters, $facet->{ sep } ); > > unless ( grep { /^\Q$data\E$/ } @used_datas ) { >-- >1.7.7.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 12788
:
31002
|
31003
|
31004
|
31005
|
31026
|
31027
|
31267
|
31268
|
31269
|
31315
|
31316
|
31317
|
31422
|
31423
|
31424