[interchange-cvs] interchange - kwalsh modified lib/Vend/Search.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Jul 5 09:19:54 EDT 2006


User:      kwalsh
Date:      2006-07-05 13:19:54 GMT
Modified:  lib/Vend Search.pm
Log:
    * Fixed a SearchOp bug reported by Tim Good in the interchange-users
      mail list.

    * Also, while I was in there, if "op=foo" is specified and "foo" is
      not found then report an error and fall back to "op=eq", as before.
      Well, the error message is new and the fallback operator appears to
      be "eq". :-)

Revision  Changes    Path
2.31      +11 -5     interchange/lib/Vend/Search.pm


rev 2.31, prev_rev 2.30
Index: Search.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -r2.30 -r2.31
--- Search.pm	30 Apr 2005 15:09:58 -0000	2.30
+++ Search.pm	5 Jul 2006 13:19:54 -0000	2.31
@@ -1,6 +1,6 @@
 # Vend::Search - Base class for search engines
 #
-# $Id: Search.pm,v 2.30 2005/04/30 15:09:58 mheins Exp $
+# $Id: Search.pm,v 2.31 2006/07/05 13:19:54 kwalsh Exp $
 #
 # Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -22,7 +22,7 @@
 
 package Vend::Search;
 
-$VERSION = substr(q$Revision: 2.30 $, 10);
+$VERSION = substr(q$Revision: 2.31 $, 10);
 
 use strict;
 no warnings qw(uninitialized numeric);
@@ -649,12 +649,18 @@
 		$c->[$i] =~ tr/ \t//;
 		my $o = $c->[$i];
 		$c->[$i] = $s->{mv_numeric}[$i]
-				? [ @{$numopmap{$o}} ]
-				: [ @{$stropmap{$o}} ];
-		if(! $c->[$i]) {
+				? $numopmap{$o}
+				: $stropmap{$o};
+		if (ref($c->[$i]) eq 'ARRAY') {
+			$c->[$i] = [ @{$c->[$i]} ];
+		}
+		elsif (!$c->[$i]) {
 			my $r;
 			$c->[$i] = [$r, $o], next
 				if  $r = Vend::Util::codedef_routine('SearchOp',$o);
+		}
+		if (!$c->[$i]) {
+		    $s->search_error("Unknown mv_column_op (%s)",$o);
 		}
 	}
 	@{$s->{mv_column_op}};








More information about the interchange-cvs mailing list