From 9d9c413c42dc124c7ef26c779c2c0758b4735ae4 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 19 May 2014 19:56:14 +0000 Subject: [PATCH] Bug 12288: (follow-up) test for defined values This patch adjusts the test so that if an "ISBN" is not defined (because the source string did not specify a valid ISBN), it doesn't result in a warning once the warnings stricture is enabled in C4::Koha. Signed-off-by: Galen Charlton --- C4/Koha.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 8dd513d86e..6f98ac6b09 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -1641,7 +1641,7 @@ sub GetVariationsOfISBN { push( @isbns, NormalizeISBN({ isbn => $isbn, format => 'ISBN-13', strip_hyphens => 1 }) ); # Strip out any "empty" strings from the array - @isbns = grep { /\S/ } @isbns; + @isbns = grep { defined($_) && $_ =~ /\S/ } @isbns; return wantarray ? @isbns : join( " | ", @isbns ); } -- 2.39.5