From fe8935ba4612b35c5e0766501e7e0caccee9ba6d Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 3 Jul 2012 17:13:22 +0800 Subject: [PATCH] Bug 8175 - Check for something in materials field fails in catalogue/details.pl The intent was clearly to know if the materials column should be displayed or not. As such, a defined check handles the NULL, 0, and '0' cases. The string match for /\S/ handles the intent of only displaying the column if is there is text in the materials field. Signed-off-by: Julian Maurice --- catalogue/detail.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index d110740..51c23c9 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -261,7 +261,7 @@ foreach my $item (@items) { $analytics_flag=1; $item->{countanalytics} = $countanalytics; } - if ($item->{'materials'} ne ''){ + if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){ $materials_flag = 1; } push @itemloop, $item; -- 1.7.10.4