From 81cf4a7b1a281555fbd157faa7f6926f7a14cac9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 18 Jun 2015 18:05:42 -0400 Subject: [PATCH] Bug 14419 - Expanding facets (Show more) performs a new search This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page. Updated tests included. Whitespace patches still needed. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Repeat for staff client 10 - Prove t/Search.t NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet. Ending punctuation seems to confuse the matcher, I'll fix it if I figure it out, but I didn't cause it. --- C4/Search.pm | 36 ++--- catalogue/search.pl | 3 +- .../intranet-tmpl/prog/en/includes/facets.inc | 16 ++- .../prog/en/modules/catalogue/results.tt | 7 + .../bootstrap/en/includes/opac-facets.inc | 20 ++- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 9 ++ opac/opac-search.pl | 7 +- t/db_dependent/Search.t | 137 +++++++++----------- 8 files changed, 115 insertions(+), 120 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 990ed39..2c901d7 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -310,23 +310,23 @@ sub SimpleSearch { ( undef, $results_hashref, \@facets_loop ) = getRecords ( - $koha_query, $simple_query, $sort_by_ref, $servers_ref, - $results_per_page, $offset, $expanded_facet, $branches,$itemtypes, - $query_type, $scan + $koha_query, $simple_query, $sort_by_ref, $servers_ref, + $results_per_page, $offset, $branches, $itemtypes, + $query_type, $scan ); The all singing, all dancing, multi-server, asynchronous, scanning, searching, record nabbing, facet-building -See verbse embedded documentation. +See verbose embedded documentation. =cut sub getRecords { my ( $koha_query, $simple_query, $sort_by_ref, $servers_ref, - $results_per_page, $offset, $expanded_facet, $branches, - $itemtypes, $query_type, $scan, $opac + $results_per_page, $offset, $branches, $itemtypes, + $query_type, $scan, $opac ) = @_; my @servers = @$servers_ref; @@ -511,8 +511,6 @@ sub getRecords { keys %$facets_counter ) { - my $expandable; - my $number_of_facets; my @this_facets_array; for my $one_facet ( sort { @@ -522,12 +520,7 @@ sub getRecords { } keys %{ $facets_counter->{$link_value} } ) { - $number_of_facets++; - if ( ( $number_of_facets <= 5 ) - || ( $expanded_facet eq $link_value ) - || ( $facets_info->{$link_value}->{'expanded'} ) - ) - { + # Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL my $facet_link_value = $one_facet; @@ -595,14 +588,8 @@ sub getRecords { } if ($facet_label_value); } - } - # handle expanded option - unless ( $facets_info->{$link_value}->{'expanded'} ) { - $expandable = 1 - if ( ( $number_of_facets > 5 ) - && ( $expanded_facet ne $link_value ) ); - } + push @facets_loop, { type_link_value => $link_value, @@ -611,8 +598,6 @@ sub getRecords { . $facets_info->{$link_value}->{'label_value'} => 1, facets => \@this_facets_array, - expandable => $expandable, - expand => $link_value, } unless ( ( @@ -833,7 +818,6 @@ sub _get_facets_info { for my $facet ( @$facets ) { $facets_info->{ $facet->{ idx } }->{ label_value } = $facet->{ label }; - $facets_info->{ $facet->{ idx } }->{ expanded } = $facet->{ expanded }; } return $facets_info; @@ -842,8 +826,8 @@ sub _get_facets_info { sub pazGetRecords { my ( $koha_query, $simple_query, $sort_by_ref, $servers_ref, - $results_per_page, $offset, $expanded_facet, $branches, - $query_type, $scan + $results_per_page, $offset, $branches, $query_type, + $scan ) = @_; my $paz = C4::Search::PazPar2->new(C4::Context->config('pazpar2url')); diff --git a/catalogue/search.pl b/catalogue/search.pl index 4d165ac..ca1cab4 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -479,7 +479,6 @@ my $offset = $params->{'offset'} || 0; my $page = $cgi->param('page') || 1; #my $offset = ($page-1)*$results_per_page; my $hits; -my $expanded_facet = $params->{'expand'}; # Define some global variables my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type); @@ -530,7 +529,7 @@ my @results_array; my $results_hashref; eval { - ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan); + ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$branches,$itemtypes,$query_type,$scan); }; # This sorts the facets into alphabetical order diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 157366e..95b7779 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -22,7 +22,11 @@ [% IF facets_loo.type_label_Location %]Locations[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 9660bb4..6cfef8a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -61,6 +61,13 @@ function cartList(){ } } $(document).ready(function() { + +$(".moretoggle").click(function(){ + $(this).siblings(".collapsible-facet").toggle(); + $(this).siblings(".moretoggle").toggle(); + $(this).toggle(); +}); + $("#cartsubmit").click(function(){ cartList(); return false; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc index 958d571..6565d59 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -30,8 +30,12 @@ [% END %] [% IF facets_loo.type_label_Location %]
Locations
[% END %] [% END # / IF facets_loo.facets.size > 0 %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index d905f13..5b09eb8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -691,13 +691,22 @@ function highlightOn() { $(".highlight_toggle").toggle(); } [% END %] + $(document).ready(function(){ + [% IF ( OpacHighlightedWords ) %] $('a.title').each(function() { $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]"); }); [% END %] +$(".moretoggle").click(function(){ + $(this).siblings(".collapsible-facet").toggle(); + $(this).siblings(".moretoggle").toggle(); + $(this).toggle(); +}); + + $(".cb").click(function(){ enableCheckboxActions(); }); diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 2c4e34e..8d3ce69 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -486,7 +486,6 @@ my $offset = $params->{'offset'} || 0; my $page = $cgi->param('page') || 1; $offset = ($page-1)*$results_per_page if $page>1; my $hits; -my $expanded_facet = $params->{'expand'}; # Define some global variables my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type); @@ -565,7 +564,7 @@ if ($tag) { # FIXME: No facets for tags search. } elsif ($build_grouped_results) { eval { - ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); + ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$branches,$query_type,$scan); }; } else { $pasarParams .= '&query=' . uri_escape_utf8($query); @@ -573,7 +572,7 @@ if ($tag) { $pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query); $pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type); eval { - ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1); + ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$branches,$itemtypes,$query_type,$scan,1); }; } # This sorts the facets into alphabetical order @@ -581,7 +580,7 @@ if ($facets) { foreach my $f (@$facets) { $f->{facets} = [ sort { uc($a->{facet_title_value}) cmp uc($b->{facet_title_value}) } @{ $f->{facets} } ]; } - @$facets = sort {$a->{expand} cmp $b->{expand}} @$facets; + @$facets = sort {$a->{type_link_value} cmp $b->{type_link_value}} @$facets; } # use Data::Dumper; print STDERR "-" x 25, "\n", Dumper($results_hashref); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index b96cc19..6856f96 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -355,12 +355,12 @@ sub run_marc21_search_tests { my $results_hashref; my $facets_loop; ( undef, $results_hashref, $facets_loop ) = - getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 101, "getRecords keyword search for 'book' matched right number of records"); is(scalar @{$results_hashref->{biblioserver}->{RECORDS}}, 19, "getRecords returned requested number of records"); my $record5 = $results_hashref->{biblioserver}->{RECORDS}->[5]; ( undef, $results_hashref, $facets_loop ) = - getRecords('kw:book', 'book', [], [ 'biblioserver' ], '20', 5, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('kw:book', 'book', [], [ 'biblioserver' ], '20', 5, \%branches, \%itemtypes, 'ccl', undef); ok(!defined $results_hashref->{biblioserver}->{RECORDS}->[0] && !defined $results_hashref->{biblioserver}->{RECORDS}->[1] && !defined $results_hashref->{biblioserver}->{RECORDS}->[2] && @@ -369,44 +369,44 @@ sub run_marc21_search_tests { $results_hashref->{biblioserver}->{RECORDS}->[5] eq $record5, "getRecords cursor works"); ( undef, $results_hashref, $facets_loop ) = - getRecords('ti:book', 'ti:book', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('ti:book', 'ti:book', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 11, "getRecords title search for 'book' matched right number of records"); ( undef, $results_hashref, $facets_loop ) = - getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); if ( $indexing_mode eq 'dom' ) { ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ , "Simple relevance sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' , "Simple ascending author sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ , "Simple descending author sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ , "Simple ascending publication date sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' @@ -414,35 +414,35 @@ if ( $indexing_mode eq 'dom' ) { } elsif ( $indexing_mode eq 'grs1' ){ ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/ , "Simple relevance sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/la enfermedad laboral\^ies$/ && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[6])->title_proper() =~ m/^Indicadores de resultados identificados/ && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'World health statistics 2009^ien' , "Simple ascending author sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'World health statistics 2009^ien' && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[12])->title_proper() =~ m/^Indicadores de resultados identificados/ && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/la enfermedad laboral\^ies$/ , "Simple descending author sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'Manual de higiene industrial^ies' && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/ , "Simple ascending publication date sorting in getRecords matches old behavior"); ( undef, $results_hashref, $facets_loop ) = - getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Estado de salud/ && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies' @@ -450,7 +450,7 @@ if ( $indexing_mode eq 'dom' ) { } ( undef, $results_hashref, $facets_loop ) = - getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); + getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, undef, 1); $record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); is($record->title_proper(), 'Books', "Scan returned requested item"); is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); @@ -464,7 +464,7 @@ if ( $indexing_mode eq 'dom' ) { $stopwords_removed, $query_type ) = buildQuery([], [ 'salud' ], [], [], [], 0, 'en'); like($query, qr/kw\W.*salud/, "Built CCL keyword query"); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 19, "getRecords generated keyword search for 'salud' matched right number of records"); my @newresults = searchResults('opac', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 18, 0, 0, @@ -476,7 +476,7 @@ if ( $indexing_mode eq 'dom' ) { $stopwords_removed, $query_type ) = buildQuery([ 'and' ], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); like($query, qr/kw\W.*salud\W.*and.*kw\W.*higiene/, "Built composed explicit-and CCL keyword query"); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 3, "getRecords generated composed keyword search for 'salud' explicit-and 'higiene' matched right number of records"); ( $error, $query, $simple_query, $query_cgi, @@ -484,7 +484,7 @@ if ( $indexing_mode eq 'dom' ) { $stopwords_removed, $query_type ) = buildQuery([ 'or' ], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); like($query, qr/kw\W.*salud\W.*or.*kw\W.*higiene/, "Built composed explicit-or CCL keyword query"); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 20, "getRecords generated composed keyword search for 'salud' explicit-or 'higiene' matched right number of records"); ( $error, $query, $simple_query, $query_cgi, @@ -492,7 +492,7 @@ if ( $indexing_mode eq 'dom' ) { $stopwords_removed, $query_type ) = buildQuery([], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); like($query, qr/kw\W.*salud\W.*and.*kw\W.*higiene/, "Built composed implicit-and CCL keyword query"); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 3, "getRecords generated composed keyword search for 'salud' implicit-and 'higiene' matched right number of records"); ( $error, $query, $simple_query, $query_cgi, @@ -501,7 +501,7 @@ if ( $indexing_mode eq 'dom' ) { like($query, qr/kw\W.*salud\W*and\W*su-to\W.*Laboratorios/, "Faceted query generated correctly"); unlike($query_desc, qr/Laboratorios/, "Facets not included in query description"); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated faceted search matched right number of records"); @@ -509,7 +509,7 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'mc-itype:MP', 'mc-itype:MU' ], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated mc-faceted search matched right number of records"); @@ -517,13 +517,13 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'mc-loc:GEN', 'branch:FFL' ], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated multi-faceted search matched right number of records"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'NEKLS' ], [ 'Code-institution' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 12, 'search using index whose name contains "ns" returns expected results (bug 10271)'); @@ -531,12 +531,12 @@ if ( $indexing_mode eq 'dom' ) { ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'book' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 101, "Search for 'book' with index set to 'kw' returns 101 hits"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([ 'and' ], [ 'book', 'another' ], [ 'kw', 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'kw:book && kw:another' returns 1 hit"); $UseQueryParser = 0; @@ -546,7 +546,7 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'available' ], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 26, "getRecords generated availability-limited search matched right number of records"); @newresults = searchResults('opac', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, @@ -562,28 +562,28 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'pqf=@attr 1=1016 "Lessig"' ], [], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 4, "getRecords PQF author search for Lessig returned proper number of matches"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'ccl=au:Lessig' ], [], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CCL author search for Lessig returned proper number of matches"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'cql=dc.author any lessig' ], [], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches"); $QueryStemming = $QueryAutoTruncate = $QueryFuzzy = $QueryRemoveStopwords = 0; @@ -592,7 +592,7 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); if ($indexing_mode eq 'grs1') { is(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); @@ -607,14 +607,14 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic' returns matches with automatic truncation on"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on"); $QueryStemming = $QueryFuzzy = $QueryRemoveStopwords = $QueryAutoTruncate = 0; @@ -622,13 +622,13 @@ if ( $indexing_mode eq 'dom' ) { ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)"); $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = $QueryAutoTruncate = 0; @@ -636,14 +636,14 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'medic' returns no matches with automatic truncation off"); ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off"); $QueryStemming = $QueryWeightFields = 1; @@ -652,7 +652,7 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on"); $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = $QueryAutoTruncate = 0; @@ -660,7 +660,7 @@ if ( $indexing_mode eq 'dom' ) { $query_desc, $limit, $limit_cgi, $limit_desc, $stopwords_removed, $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); - ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'pressed' returns no matches when stemming is off"); # Let's see what happens when we pass bad data into these routines. @@ -671,16 +671,16 @@ if ( $indexing_mode eq 'dom' ) { isnt($error, undef, "SimpleSearch returns an error when passed gibberish"); warning_like {( undef, $results_hashref, $facets_loop ) = - getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'nonsense', undef) } + getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'nonsense', undef) } qr/Unknown query_type/, "getRecords warns about unknown query type"; warning_like {( undef, $results_hashref, $facets_loop ) = - getRecords('pqf=@attr 1=4 "title"', 'pqf=@attr 1=4 "title"', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, '', undef) } + getRecords('pqf=@attr 1=4 "title"', 'pqf=@attr 1=4 "title"', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, '', undef) } qr/WARNING: query problem/, "getRecords warns when query type is not specified for non-CCL query"; # Let's just test a few other bits and bobs, just for fun - ($error, $results_hashref, $facets_loop) = getRecords("Godzina pąsowej róży","Godzina pąsowej róży",[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords("Godzina pąsowej róży","Godzina pąsowej róży",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); @newresults = searchResults('intranet', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, $results_hashref->{'biblioserver'}->{"RECORDS"}); is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly'); @@ -699,14 +699,14 @@ if ( $indexing_mode eq 'dom' ) { } }); - ($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + ($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); @newresults = searchResults('intranet', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, $results_hashref->{'biblioserver'}->{"RECORDS"}); ok(!exists($newresults[0]->{norequests}), 'presence of a transit does not block hold request action (bug 10741)'); ## Regression test for bug 10684 ( undef, $results_hashref, $facets_loop ) = - getRecords('ti:punctuation', 'punctuation', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('ti:punctuation', 'punctuation', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 1, "search for ti:punctuation returned expected number of records"); @newresults = searchResults('intranet', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 20, 0, 0, $results_hashref->{'biblioserver'}->{"RECORDS"}); @@ -841,7 +841,7 @@ if ( $indexing_mode eq 'dom' ) { # retrieve records that are larger than the MARC limit of 99,999 octets ( undef, $results_hashref, $facets_loop ) = - getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)"); @newresults = searchResults('opac', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, $results_hashref->{'biblioserver'}->{"RECORDS"}); @@ -858,7 +858,7 @@ if ( $indexing_mode eq 'dom' ) { # verify that we don't attempt to sort if no results were returned # because of a query error warning_like {( undef, $results_hashref, $facets_loop ) = - getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef) + getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef) } qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)'; # Test facet calculation @@ -889,22 +889,14 @@ if ( $indexing_mode eq 'dom' ) { # Test _get_facets_info my $facets_info = C4::Search::_get_facets_info( $facets ); my $expected_facets_info_marc21 = { - 'au' => { 'expanded' => undef, - 'label_value' => "Authors" }, - 'holdingbranch' => { 'expanded' => undef, - 'label_value' => "HoldingLibrary" }, - 'itype' => { 'expanded' => undef, - 'label_value' => "ItemTypes" }, - 'location' => { 'expanded' => undef, - 'label_value' => "Location" }, - 'se' => { 'expanded' => undef, - 'label_value' => "Series" }, - 'su-geo' => { 'expanded' => undef, - 'label_value' => "Places" }, - 'su-to' => { 'expanded' => undef, - 'label_value' => "Topics" }, - 'su-ut' => { 'expanded' => undef, - 'label_value' => "Titles" } + 'au' => { 'label_value' => "Authors" }, + 'holdingbranch' => { 'label_value' => "HoldingLibrary" }, + 'itype' => { 'label_value' => "ItemTypes" }, + 'location' => { 'label_value' => "Location" }, + 'se' => { 'label_value' => "Series" }, + 'su-geo' => { 'label_value' => "Places" }, + 'su-to' => { 'label_value' => "Topics" }, + 'su-ut' => { 'label_value' => "Titles" } }; is_deeply( $facets_info, $expected_facets_info_marc21, "_get_facets_info returns the correct data"); @@ -984,20 +976,13 @@ sub run_unimarc_search_tests { my $facets = C4::Koha::getFacets(); my $facets_info = C4::Search::_get_facets_info( $facets ); my $expected_facets_info_unimarc = { - 'au' => { 'expanded' => undef, - 'label_value' => "Authors" }, - 'holdingbranch' => { 'expanded' => undef, - 'label_value' => "HoldingLibrary" }, - 'location' => { 'expanded' => undef, - 'label_value' => "Location" }, - 'se' => { 'expanded' => undef, - 'label_value' => "Series" }, - 'su-geo' => { 'expanded' => undef, - 'label_value' => "Places" }, - 'su-to' => { 'expanded' => undef, - 'label_value' => "Topics" }, - 'su-ut' => { 'expanded' => undef, - 'label_value' => "Titles" } + 'au' => { 'label_value' => "Authors" }, + 'holdingbranch' => { 'label_value' => "HoldingLibrary" }, + 'location' => { 'label_value' => "Location" }, + 'se' => { 'label_value' => "Series" }, + 'su-geo' => { 'label_value' => "Places" }, + 'su-to' => { 'label_value' => "Topics" }, + 'su-ut' => { 'label_value' => "Titles" } }; is_deeply( $facets_info, $expected_facets_info_unimarc, "_get_facets_info returns the correct data"); -- 1.7.10.4