--- trunk/lib/WebPAC/Output/TT.pm 2006/01/08 22:21:24 375 +++ trunk/lib/WebPAC/Output/TT.pm 2006/01/08 22:41:45 376 @@ -196,19 +196,27 @@ my $s; if ($s_el > 0) { - $s = $item->{'search'}->[$i] || die "can't find value $i for type search in field $search"; + $s = $item->{'search'}->[$i]; + die "can't find value $i for type search in field $search" unless (defined($s)); } else { $s = $item->{'search'}->[0]; } #$s =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg; $s = __quotemeta( $s ); - my $d = $item->{'display'}->[$i] || die "can't find value $i for type display in field $display"; + my $d = $item->{'display'}->[$i]; + die "can't find value $i for type display in field $display" unless (defined($d)); my $template_arg = ''; $template_arg = qq{,'$template'} if ($template); - push @html, qq{$d}; + if ($s && ! $d) { + $d = $s; + } elsif (! $s && $d) { + $s = $d; + } + + push @html, qq{$d} if ($s && $d); } return join($delimiter, @html);