SOLVED!
The problem lies in funtion create_list_query() in file modules/Contact/Contact.php
Simply insert one line from the previous revision to fix the problem. I have marked the line.
kbrill: What is the version of this file on your system? And how does this function compare?
Code:
/* $Id: Contact.php,v 1.180.2.3 2005/11/14 17:48:19 jli Exp $ */
function create_list_query($order_by, $where, $show_deleted = 0)
{
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT ";
$query .= "
$this->table_name.*,
accounts.name as account_name,
accounts.id as account_id,
users.user_name as assigned_user_name ";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= "
FROM contacts ";
$query .= "LEFT JOIN users
ON contacts.assigned_user_id=users.id
LEFT JOIN accounts_contacts
ON contacts.id=accounts_contacts.contact_id
LEFT JOIN accounts
ON accounts_contacts.account_id=accounts.id ";
if($custom_join){
$query .= $custom_join['join'];
}
$where_auto = '1=1';
if($show_deleted == 0){
$where_auto = " $this->table_name.deleted=0 ";
$where_auto .= " AND (accounts.deleted is NULL or accounts.deleted=0) ";
// ****** insert the following line ******* /.
$where_auto .= " AND (accounts_contacts.deleted is NULL or accounts_contacts.deleted=0) ";
}else if($show_deleted == 1){
$where_auto = " $this->table_name.deleted=1 ";
}
if($where != "")
$query .= "where ($where) AND ".$where_auto;
else
$query .= "where ".$where_auto;
if(!empty($order_by))
$query .= " ORDER BY $order_by";
return $query;
} Regards,
Rich
Bookmarks