[interchange-cvs] interchange - heins modified lib/Vend/Form.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Mon Jun 10 21:20:01 2002


User:      heins
Date:      2002-06-11 01:15:49 GMT
Modified:  lib/Vend Form.pm
Log:
	* Change precedence of option source so that a lookup query
	  will override passed options

Revision  Changes    Path
2.16      +6 -6      interchange/lib/Vend/Form.pm


rev 2.16, prev_rev 2.15
Index: Form.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Form.pm,v
retrieving revision 2.15
retrieving revision 2.16
diff -u -r2.15 -r2.16
--- Form.pm	16 Feb 2002 08:17:14 -0000	2.15
+++ Form.pm	11 Jun 2002 01:15:49 -0000	2.16
@@ -1,6 +1,6 @@
 # Vend::Form - Generate Form widgets
 # 
-# $Id: Form.pm,v 2.15 2002/02/16 08:17:14 mheins Exp $
+# $Id: Form.pm,v 2.16 2002/06/11 01:15:49 mheins Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -37,7 +37,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.15 $, 10);
+$VERSION = substr(q$Revision: 2.16 $, 10);
 
 @EXPORT = qw (
 	display
@@ -943,10 +943,7 @@
 
 	my $look;
 
-	if($opt->{passed}) {
-		$data = options_to_array($opt->{passed}, $opt);
-	}
-	elsif($look = $opt->{lookup_query}) {
+	if($look = $opt->{lookup_query}) {
 		my $tab = $opt->{table} || $Vend::Cfg->{ProductFiles}[0];
 		my $db = Vend::Data::database_exists_ref($tab);
 		$data = $db->query($look)
@@ -981,6 +978,9 @@
 				}
 			};
 		}
+	}
+	elsif($opt->{passed}) {
+		$data = options_to_array($opt->{passed}, $opt);
 	}
 	elsif($opt->{column} and $opt->{table}) {
 		GETDATA: {