Index: openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl,v
diff -u -r1.33 -r1.34
--- openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl	2 Jun 2006 09:56:23 -0000	1.33
+++ openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl	13 Jun 2006 00:46:07 -0000	1.34
@@ -51,6 +51,7 @@
 	    type_name {
 	    }
 	}
+	ns_log notice "Contacts SEARCH CONDITION: contacts::search::condition_type::${type} -request $request -form_name $form_name -var_list $var_list -party_id $party_id -revision_id $revision_id -object_type $object_type -prefix $prefix -package_id $package_id "
 	return [contacts::search::condition_type::${type} -request $request -form_name $form_name -var_list $var_list -party_id $party_id -revision_id $revision_id -object_type $object_type -prefix $prefix -package_id $package_id]
     } else {
 	# the widget requested did not exist
@@ -614,7 +615,7 @@
                                       ]
 
             # login and not_login do not need special elements
-            if { [lsearch [list in_search not_in_search] ${operand}] >= 0 || ${operand} == "" } {
+            if { [lsearch [list in_search not_in_search] ${operand}] >= 0 } {
                 set user_id [ad_conn user_id]
 		set search_options [list [list "" "" ""]]
                 db_foreach get_my_searches {
@@ -657,6 +658,7 @@
             return $form_elements
         }
         form_var_list {
+	    ns_log notice "$operand [set $var1] [set $var2]"
             if { [exists_and_not_null operand] } {
                 switch ${operand} {
                     login - not_login {
@@ -666,10 +668,10 @@
                         return ${operand}
                     }
                     in_search - not_in_search {
-                        if { [exists_and_not_null ${var1}] } {
+                        if { [string is integer [set ${var1}]] && [set ${var1}] ne "" } {
                             return [list ${operand} [set ${var1}]]
                         } else {
-			    template::element::set_error $form_name ${var1} [_ contacts.Required]
+			     template::element::set_error $form_name ${var1} [_ contacts.Required]
 			}
                     }
 		    interacted_between - not_interacted_between {
@@ -689,6 +691,7 @@
                     }
                 }
             }
+	    return {}
         }
         sql - pretty {
             set operand [lindex $var_list 0]
@@ -814,6 +817,12 @@
 		    set output_code "${party_id} in ( select ${operand}${prefix}.party_id from contact_privacy ${operand}${prefix} where ${operand}${prefix}.$condition )"
 		}
             }
+	    if { ![exists_and_not_null output_pretty] } {
+		set output_pretty "no pretty output"
+	    }
+	    if { ![exists_and_not_null output_code] } {
+		set output_code "1 = 1"
+	    }
             if { $request == "pretty" } {
                 return $output_pretty
             } else {