[rt-users] [PATCH] Extra 0 when displaying custom fields with multiple values

Quentin Garnier cube at cubidou.net
Thu Aug 9 06:22:45 EDT 2007


Hi,

We use custom fields with multiple values, and we notice an extra 0
after the value itself.

While we use RT 3.4.6, the code is mostly the same in RT 3.6.4, so I
wonder how nobody could have noticed that before.

When a custom field has more than one value, ShowCustomFields does the
following:

<li><% $print_value->( $CustomField, $Value ) |n %></li>

The problem is, $print_value doesn't return a value, so 0 is used.  I
can't really make sense of the |n here, which doesn't change the
resulting value, as 0|n is still 0 (why Perl parses that is beyond my
understanding).

The attached patch fixes the issue for me, but I really wonder what the
intent of the previous code was.  If anyone can enlighten me...  And if
the patch is the intended feature, feel free to commit it...

-- 
Quentin Garnier - cube at cubidou.net - cube at NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.
-------------- next part --------------
$NetBSD$

Fix a bug (?) where a 0 was displayed after a value for multiple-values
custom fields.

--- html/Elements/ShowCustomFields.orig	2006-08-17 00:56:58.000000000 +0200
+++ html/Elements/ShowCustomFields
@@ -57,7 +57,9 @@
 % } else {
 <ul>
 % while ( my $Value = $Values->Next ) {
-<li><% $print_value->( $CustomField, $Value ) |n %></li>
+<li>
+% $print_value->( $CustomField, $Value );
+</li>
 % }
 </ul>
 % }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 478 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070809/140d8d3e/attachment.sig>


More information about the rt-users mailing list