From c7149ff9bbbf98c9429aaa7fab6fc018c173ddd5 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Sun, 19 Jan 2014 12:02:44 -0300 Subject: [PATCH] Bug 11096: (qa followup) facets count and UNIMARC record syntax - An error in a copy and paste operation made me count facet occurences instead of records where the fields where present. - As of bug 3087 UNIMARC uses the 'unimarc' record syntax. I assumed 'usmarc' was used as serialization format as thought it was dialect-agnostic. This patch adds a test of whether we are in UNIMARC context or not and sets the record syntax to match the one from koha-conf.xml. Regards To+ Signed-off-by: Jonathan Druart --- C4/Context.pm | 4 +++- C4/Search.pm | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index e96d399..746d24b 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -738,7 +738,9 @@ sub _new_Zconn { or ($server eq 'authorityserver' and $context->{'config'}->{'zebra_auth_index_mode'} eq 'grs1')) { $elementSetName = 'F'; - $syntax = 'usmarc'; + $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' ) + ? 'unimarc' + : 'usmarc'; } else { diff --git a/C4/Search.pm b/C4/Search.pm index c108323..3217421 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -551,10 +551,8 @@ sub getRecords { unless ( $data ~~ @used_datas ) { push @used_datas, $data; + $facets_counter->{ $facet->{idx} }->{$data}++; } - - $facets_counter->{ $facet->{idx} }->{$data}++; - } # fields } # field codes } # records -- 1.7.10.4