- my $values = $_[0]->CustomFieldValues( $_[-1] );
- my @values = map {
- (
- ($_->CustomFieldObj->Type eq 'Image')
- ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ ))
- : $_->Content
- ),
- \'<br />',
- } @{ $values->ItemsArrayRef };
+ my $values = $cf->ValuesForObject( $_[0] );
+ return if $values->Count == 0;
+ my @values;
+ # it is guaranteed to be the same type for all fields, right?
+ my $v = $values->First;
+
+ do {
+ if ($v->Type eq 'Image') {
+ push @values,
+ \($m->scomp( '/Elements/ShowCustomFieldImage',
+ Object => $v ));
+ } elsif ( $v->Type eq 'Date' or $v->Type eq 'DateTime' ) {
+ # then actually return the date object;
+ # ProcessColumnMapValue will stringify it
+ my $DateObj = RT::Date->new( $session{'CurrentUser'} );
+ $DateObj->Set(Format => 'unknown', Value => $v->Content);
+ push @values, $DateObj;
+ } else {
+ push @values, $v->Content;
+ }
+ push @values, \'<br />'; # this is deeply silly
+ } while ($v = $values->Next);