From 53e93ebaa1e1e0ec4675dfbe358375812aefcb37 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 21 Nov 2016 12:08:52 -0500 Subject: [PATCH] Bug 17664: Silence non-zebra warnings in t/db_dependent/Search.t TEST PLAN --------- 0) back up database 1) drop database; create database 2) run web installer 3) prove t/db_dependent/Search.t -- the spammy warnings (other than zebra index warnings) may already be fixed, but the mocked value was not realistic. 4) apply patch 5) prove t/db_dependent/Search.t -- notice only zebra index warnings. 6) run qa test tools Signed-off-by: Alex Buckley Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart (cherry picked from commit 5e63a3838102ee1fe8a1bc15640196ab611dbc89) Signed-off-by: Fridolin Somers (cherry picked from commit 23c8acd61590de50bcfa2779afc35fb7d5dd6488) Signed-off-by: Katrin Fischer Conflicts: t/db_dependent/Search.t --- Koha/QueryParser/Driver/PQF/query_plan/node.pm | 2 +- t/db_dependent/Search.t | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Koha/QueryParser/Driver/PQF/query_plan/node.pm b/Koha/QueryParser/Driver/PQF/query_plan/node.pm index a50347e18c..353d7602d1 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan/node.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan/node.pm @@ -49,7 +49,7 @@ sub target_syntax { foreach my $field (@{$self->fields}) { $fieldobj = $self->plan->QueryParser->bib1_mapping_by_name('field', $self->classname, $field, $server); $relbump = $self->plan->QueryParser->bib1_mapping_by_name('relevance_bump', $self->classname, $field, $server); - if ($relbump) { + if ($relbump && defined $relbump->{'attr_string'}) { $fieldobj->{'attr_string'} .= ' ' . $relbump->{'attr_string'}; } push @fields, $fieldobj unless (!defined($fieldobj) || ($field eq $self->classname && @{$self->fields} > 1)); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index f66fc3e08f..608592b7e0 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -132,6 +132,10 @@ $contextmodule->mock('preference', sub { return 'holding'; } elsif ($pref eq 'UNIMARCAuthorsFacetsSeparator') { return '--'; + } elsif ($pref eq 'casAuthentication' or $pref eq 'casLogout' or $pref eq 'casServerUrl' ) { + return ''; + } elsif ($pref eq 'template') { + return 'prog'; } else { warn "The syspref $pref was requested but I don't know what to say; this indicates that the test requires updating" unless $pref =~ m/(XSLT|item|branch|holding|image)/i; -- 2.39.5