Index: openacs-4/packages/contacts/tcl/contact-search-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-procs.tcl,v
diff -u -r1.34 -r1.35
--- openacs-4/packages/contacts/tcl/contact-search-procs.tcl	26 Jun 2006 08:26:53 -0000	1.34
+++ openacs-4/packages/contacts/tcl/contact-search-procs.tcl	29 Jun 2006 08:16:14 -0000	1.35
@@ -289,9 +289,14 @@
 	set cr_from ""
 	set cr_where ""
     }
-    
-    return [db_string select_${object_type}_results_count {}]
 
+    set results ""
+    db_transaction {
+	# we don't want to break the contact searches page if there is an error.
+	set results [db_string select_${object_type}_results_count {}]
+    } on_error {}
+    return $results
+
 }
 
 ad_proc -private contact::party_id_in_sub_search_clause {
@@ -308,6 +313,7 @@
         set group_where_clause "and group_distinct_member_map.group_id in ([template::util::tcl_to_sql_list [contacts::default_groups]])"
 #        set group_where_clause "and group_distinct_member_map.group_id = [contacts::default_group]"
     }
+
     set query "
     select parties.party_id
       from parties left join cr_items on (parties.party_id = cr_items.item_id) left join cr_revisions on (cr_items.latest_revision = cr_revisions.revision_id ),
@@ -316,6 +322,10 @@
      $group_where_clause
     [contact::search_clause -and -search_id $search_id -query "" -party_id "parties.party_id" -revision_id "revision_id"]
     "
+
+
+
+
     if { [exists_and_not_null query] } {
         set result ${party_id}
         if { $not_p } {
@@ -403,12 +413,12 @@
     set db_conditions [db_list_of_lists select_conditions {}]
     set conditions [list]
     foreach condition $db_conditions {
-        lappend conditions [contacts::search::condition_type \
+	lappend conditions [contacts::search::condition_type \
 				-type [lindex $condition 0] \
 				-request pretty \
 				-var_list [lindex $condition 1] \
 				-object_type $object_type
-			       ]
+			   ]
     }
 
     if { [llength $conditions] > 0 } {