From 5ab93391a37390b818c3b391915bdedc3f07fe3e Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 18 Jan 2024 14:39:55 +0100 Subject: [PATCH] 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 Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer (cherry picked from commit 857d8f4d826cf513a6a4ba22a324890f7e5f2bd3) Signed-off-by: Fridolin Somers --- C4/Koha.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 081d87659b..41b6003de4 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -599,7 +599,7 @@ sub GetNormalizedUPC { foreach my $field (@fields) { my $indicator = $field->indicator(1); my $upc = _normalize_match_point($field->subfield('a')); - if ($upc && $indicator == 1 ) { + if ($upc && $indicator eq '1' ) { return $upc; } } @@ -658,7 +658,7 @@ sub GetNormalizedEAN { foreach my $field (@fields) { my $indicator = $field->indicator(1); my $ean = _normalize_match_point($field->subfield('a')); - if ( $ean && $indicator == 3 ) { + if ( $ean && $indicator eq '3' ) { return $ean; } } -- 2.39.5