From 2831770a9557263b0e4edf3bdc4f17c82475bced 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 --- Koha/QueryParser/Driver/PQF/query_plan/node.pm | 2 +- t/db_dependent/Search.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 c8cbc48171..6e02b15cef 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -139,7 +139,7 @@ $contextmodule->mock('preference', sub { } elsif ($pref eq 'casAuthentication' or $pref eq 'casLogout' or $pref eq 'casServerUrl' ) { return ''; } elsif ($pref eq 'template') { - return ''; + 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