Bugzilla – Attachment 161390 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.89 KB, created by
Jonathan Druart
on 2024-01-25 10:53:34 UTC
(
hide
)
Description:
Bug 35833: Silence few warnings from searching
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-01-25 10:53:34 UTC
Size:
1.89 KB
patch
obsolete
>From 556db28e4453ca98540560731208bcfccac40d2b 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 > >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> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 e2de36571e2..248856e42b2 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 ae864ee30cf..16b69332ff3 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.34.1
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