[interchange-cvs] interchange - racke modified lib/Vend/Swish2.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Aug 23 08:22:51 EDT 2006


User:      racke
Date:      2006-08-23 12:22:51 GMT
Modified:  lib/Vend Swish2.pm
Log:
avoid formatting of missing dates

Revision  Changes    Path
1.10      +6 -6      interchange/lib/Vend/Swish2.pm


rev 1.10, prev_rev 1.9
Index: Swish2.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Swish2.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Swish2.pm	28 Jun 2006 14:59:46 -0000	1.9
+++ Swish2.pm	23 Aug 2006 12:22:50 -0000	1.10
@@ -1,6 +1,6 @@
 # Vend::Swish2 - Search indexes with Swish-e's new SWISH::API
 #
-# $Id: Swish2.pm,v 1.9 2006/06/28 14:59:46 racke Exp $
+# $Id: Swish2.pm,v 1.10 2006/08/23 12:22:50 racke Exp $
 #
 # Adapted from Vend::Swish by Brian Miller <brian at endpoint.com>
 #
@@ -26,7 +26,7 @@
 require Vend::Search;
 @ISA = qw(Vend::Search);
 
-$VERSION = substr(q$Revision: 1.9 $, 10);
+$VERSION = substr(q$Revision: 1.10 $, 10);
 use strict;
 
 use SWISH::API;
@@ -231,8 +231,8 @@
     while (my $result = $results->NextResult) {
         my $out_ref = [];
         foreach my $field (@{ $s->{'mv_field_names'} }) {
+			my $text = $result->Property( $fmap{$field} );
             if ($field =~ /context/) {
-                my $text = $result->Property( $fmap{$field} );
                 if ($Vend::Cfg->{'Swish2'}{'highlight_context'} and defined $text and $text ne '') {
                     my $index = $result->Property('swishdbfile');
 
@@ -243,11 +243,11 @@
                 }
                 push @$out_ref, $text;
             }
-			elsif ($field eq 'mod_date') {
-				push @$out_ref, POSIX::strftime($date_format, localtime($result->Property( $fmap{$field} )));
+			elsif ($field eq 'mod_date' && $text) {
+				push @$out_ref, POSIX::strftime($date_format, localtime($text));
 			}
 			else {
-                push @$out_ref, $result->Property( $fmap{$field} );
+                push @$out_ref, $text;
             }
         }
         








More information about the interchange-cvs mailing list