From 09bfe009aa6d3f6d9e585a6a843853b3335c2269 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 1 May 2007 08:18:33 +0000 Subject: [PATCH] fix for bug #626: sql error when adding to distribution list --- addressbook/inc/class.socontacts_sql.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addressbook/inc/class.socontacts_sql.inc.php b/addressbook/inc/class.socontacts_sql.inc.php index 625010b37d..cda7f2d30c 100644 --- a/addressbook/inc/class.socontacts_sql.inc.php +++ b/addressbook/inc/class.socontacts_sql.inc.php @@ -432,6 +432,13 @@ class socontacts_sql extends so_sql { if (!(int)$list || !(int)$contact) return false; + if ($this->db->select($this->ab2list_table,'list_id',array( + 'contact_id' => $contact, + 'list_id' => $list, + ),__LINE__,__FILE__) && $this->db->next_record()) + { + return true; // no need to insert it, would give sql error + } return $this->db->insert($this->ab2list_table,array( 'contact_id' => $contact, 'list_id' => $list,