Bugzilla – Attachment 161138 Details for
Bug 35833
Fix few noisy warnings from C4/Koha and search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35833: Silence few warnings from searching
Bug-35833-Silence-few-warnings-from-searching.patch (text/plain), 1.85 KB, created by
Marcel de Rooy
on 2024-01-18 13:54:26 UTC
(
hide
)
Description:
Bug 35833: Silence few warnings from searching
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-01-18 13:54:26 UTC
Size:
1.85 KB
patch
obsolete
>From 12dd32609540bda1cb5b358c8f016113303a3f85 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 18 Jan 2024 14:46:45 +0100 >Subject: [PATCH] Bug 35833: Silence few warnings from searching >Content-Type: text/plain; charset=utf-8 > >Resolve: >[2024/01/18 11:31:24] [WARN] Use of uninitialized value $hits in numeric eq (==) at /usr/share/koha/opac/opac-search.pl line 612. >[2024/01/18 11:31:24] [WARN] Use of uninitialized value $times in subtraction (-) at /usr/share/koha/C4/Search.pm line 1715. > >Test plan: >Look for a few search expressions without results. >Check log without and with patch. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Search.pm | 2 +- > opac/opac-search.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index e2de36571e..248856e42b 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1694,7 +1694,7 @@ sub searchResults { > $times = $offset + $results_per_page; > } > else { >- $times = $hits; # If less hits than results_per_page+offset we go to the end >+ $times = $hits // 0; # If less hits than results_per_page+offset we go to the end > } > > my $marcflavour = C4::Context->preference("marcflavour"); >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index ae864ee30c..16b69332ff 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -608,7 +608,7 @@ for my $plugin_variables ( @plugin_responses ) { > for (my $i=0;$i<@servers;$i++) { > my $server = $servers[$i]; > if ($server && $server =~/biblioserver/) { # this is the local bibliographic server >- $hits = $results_hashref->{$server}->{"hits"}; >+ $hits = $results_hashref->{$server}->{"hits"} // 0; > if ( $hits == 0 && $basic_search ){ > $operands[0] = '"'.$operands[0].'"'; #quote it > ## I. BUILD THE QUERY >-- >2.30.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 35833
:
161136
|
161138
|
161389
|
161390