Bug 8175 - check logs error or displays incorrectly in details.pl
Changed "$item->{'materials'} ne ''" to "defined($item->{'materials'}) && $item->{'materials'} =~ /\S/" in if condition to prevent error when it is NULL, and to properly capture the intent of printing if there is something visible. Cases tested include NULL, '0', '', ' ', and 'blah' by using UPDATE items SET materials=NULL where biblionumber=19158; where the biblionumber was chosen randomly, because only NULL was in the items.materials field. The NULL case triggers an error, but it does display correctly. The ' ' case displays an apparently empty column, which does not seem to be the intent of the flag that is being set. This is why a simple $var check is not sufficient. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
parent
caec1ddfa4
commit
b8f4b1fa14
1 changed files with 1 additions and 1 deletions
|
@ -263,7 +263,7 @@ foreach my $item (@items) {
|
||||||
$analytics_flag=1;
|
$analytics_flag=1;
|
||||||
$item->{countanalytics} = $countanalytics;
|
$item->{countanalytics} = $countanalytics;
|
||||||
}
|
}
|
||||||
if ($item->{'materials'} ne ''){
|
if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
|
||||||
$materials_flag = 1;
|
$materials_flag = 1;
|
||||||
}
|
}
|
||||||
push @itemloop, $item;
|
push @itemloop, $item;
|
||||||
|
|
Loading…
Reference in a new issue