Bugzilla – Attachment 169422 Details for
Bug 37433
Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37433: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance
Bug-37433-Warning-Use-of-uninitialized-value-fd-in.patch (text/plain), 2.13 KB, created by
Roman Dolny
on 2024-07-23 14:04:09 UTC
(
hide
)
Description:
Bug 37433: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-23 14:04:09 UTC
Size:
2.13 KB
patch
obsolete
>From 921e9038dce8507b4160d2d31e685d347b952926 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 23 Jul 2024 12:49:36 +0000 >Subject: [PATCH] Bug 37433: Warning 'Use of uninitialized value $f/$d in hash > element...' in log when sorting by relevance > >With ES, searches with Sort set to Relevance produce following warnings >in log file: > >[WARN] Use of uninitialized value $f in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728. >[WARN] Use of uninitialized value $d in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728. > >This is because sort_by = 'relevance' does not contain underscore. > >Test plan: >========== >1. Have a test environment with ES enabled. >2. Perform a search for a common word (like 'greek'). Make sure that > the sort order is set to 'Relevance' (the default option in ktd). > Check the content of the plack-intranet-error.log file--you should > see warning lines with a messages > "Use of uninitialized value $f in hash element ..." > "Use of uninitialized value $d in hash element ..." >3. Apply the patch; restart_all. >4. Repeat p. 2. The log should be clean now. > >Sponsored-by: Ignatianum University in Cracow >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index dea84c83a2..ef91b125a3 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -720,9 +720,11 @@ sub _convert_sort_fields { > # Convert the fields and orders, drop anything we don't know about. > grep { $_->{field} } map { > my ( $f, $d ) = /(.+)_(.+)/; >- { >- field => $sort_field_convert{$f}, >- direction => $sort_order_convert{$d} >+ if ( $f && $d ) { >+ { >+ field => $sort_field_convert{$f}, >+ direction => $sort_order_convert{$d}, >+ } > } > } @sort_by; > } >-- >2.39.2
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 37433
:
169418
| 169422