Bug 35833 - Fix few noisy warnings from C4/Koha and search
Summary: Fix few noisy warnings from C4/Koha and search
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25790
  Show dependency treegraph
 
Reported: 2024-01-18 13:39 UTC by Marcel de Rooy
Modified: 2024-02-01 14:08 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.03
Circulation function:


Attachments
Bug 35833: Fix warnings from C4/Koha (1.66 KB, patch)
2024-01-18 13:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35833: Silence few warnings from searching (1.85 KB, patch)
2024-01-18 13:54 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35833: Fix warnings from C4/Koha (1.69 KB, patch)
2024-01-25 10:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35833: Silence few warnings from searching (1.89 KB, patch)
2024-01-25 10:53 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2024-01-18 13:39:34 UTC
[2024/01/18 11:52:40] [WARN] Argument " " isn't numeric in numeric eq (==) at /usr/share/koha/C4/Koha.pm line 600.
[2024/01/18 11:52:40] [WARN] Argument " " isn't numeric in numeric eq (==) at /usr/share/koha/C4/Koha.pm line 659.

[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.

Line numbers may vary for master.
Comment 1 Marcel de Rooy 2024-01-18 13:43:58 UTC
Created attachment 161136 [details] [review]
Bug 35833: Fix warnings from C4/Koha

[2024/01/18 11:52:40] [WARN] Argument " " isn't numeric in numeric eq (==) at /usr/share/koha/C4/Koha.pm line 600.
[2024/01/18 11:52:40] [WARN] Argument " " isn't numeric in numeric eq (==) at /usr/share/koha/C4/Koha.pm line 659.

Note: According to the code in MARC::Field the indicator returned cannot be undef. So we do not return new
uninitialized warnings.

Test plan:
Check your log before and after patch.
Possibly you may need to create a record with spaces as field indicators.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2024-01-18 13:54:26 UTC
Created attachment 161138 [details] [review]
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>
Comment 3 Marcel de Rooy 2024-01-18 13:54:46 UTC
Trivial + architecture. Self SO
Comment 4 Jonathan Druart 2024-01-25 10:53:32 UTC
Created attachment 161389 [details] [review]
Bug 35833: Fix warnings from C4/Koha

[2024/01/18 11:52:40] [WARN] Argument " " isn't numeric in numeric eq (==) at /usr/share/koha/C4/Koha.pm line 600.
[2024/01/18 11:52:40] [WARN] Argument " " isn't numeric in numeric eq (==) at /usr/share/koha/C4/Koha.pm line 659.

Note: According to the code in MARC::Field the indicator returned cannot be undef. So we do not return new
uninitialized warnings.

Test plan:
Check your log before and after patch.
Possibly you may need to create a record with spaces as field indicators.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2024-01-25 10:53:34 UTC
Created attachment 161390 [details] [review]
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>
Comment 6 Katrin Fischer 2024-01-29 11:29:23 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-02-01 14:08:58 UTC
Pushed to 23.11.x for 23.11.03