Bugzilla – Attachment 11937 Details for
Bug 8175
items.materials check logs error or displays incorrectly in details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
items.materials=NULL triggers error, =' ' displays empty column
0001-Bug-8175-check-logs-error-or-displays-incorrectly-in.patch (text/plain), 1.45 KB, created by
Mark Tompsett
on 2012-09-02 13:21:33 UTC
(
hide
)
Description:
items.materials=NULL triggers error, =' ' displays empty column
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2012-09-02 13:21:33 UTC
Size:
1.45 KB
patch
obsolete
>From 91523fd99bf7248de87ab947e1d6226b7bf20e57 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sun, 2 Sep 2012 20:46:03 +0800 >Subject: [PATCH] Bug 8175 - check logs error or displays incorrectly in > details.pl >Content-Type: text/plain; charset="utf-8" > >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. >--- > catalogue/detail.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index f2ad4eb..b630d5e 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.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8175
:
10566
|
10577
|
10620
|
11496
|
11937
|
11956