From 6d04243cd693ece49983b68a00f3df53c7bf6f4f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 3 Jun 2007 09:49:10 +0000 Subject: [PATCH] "fix for bug #838: Distributionlist as mail addres: XML Response from server invalid" --- addressbook/inc/class.socontacts_sql.inc.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addressbook/inc/class.socontacts_sql.inc.php b/addressbook/inc/class.socontacts_sql.inc.php index afb8412e22..7f3a5b2cbf 100644 --- a/addressbook/inc/class.socontacts_sql.inc.php +++ b/addressbook/inc/class.socontacts_sql.inc.php @@ -290,7 +290,14 @@ class socontacts_sql extends so_sql if ($search_customfields) // search the custom-fields { $join .= $this->extra_join; - + } + if (isset($filter['list'])) + { + $join .= " JOIN $this->ab2list_table ON $this->table_name.contact_id=$this->ab2list_table.contact_id AND list_id=".(int)$filter['list']; + unset($filter['list']); + } + if ($join) + { switch(gettype($only_keys)) { case 'boolean': @@ -322,11 +329,6 @@ class socontacts_sql extends so_sql unset($filter['owner']); } } - if (isset($filter['list'])) - { - $join .= " JOIN $this->ab2list_table ON $this->table_name.contact_id=$this->ab2list_table.contact_id AND list_id=".(int)$filter['list']; - unset($filter['list']); - } $rows =& parent::search($criteria,$only_keys,$order_by,$extra_cols,$wildcard,$empty,$op,$start,$filter,$join,$need_full_no_count); if ($start === false) $this->total = is_array($rows) ? count($rows) : 0; // so_sql sets total only for $start !== false!