From d60659935a356984a816e260daf698321255b6c7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 15 Apr 2007 13:25:06 +0000 Subject: [PATCH] fix for bug #589: SQL error on adding an existing distribution list again --- addressbook/inc/class.socontacts_sql.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.socontacts_sql.inc.php b/addressbook/inc/class.socontacts_sql.inc.php index fff69c7b41..625010b37d 100644 --- a/addressbook/inc/class.socontacts_sql.inc.php +++ b/addressbook/inc/class.socontacts_sql.inc.php @@ -396,7 +396,14 @@ class socontacts_sql extends so_sql function add_list($name,$owner,$contacts=array()) { if (!$name || !(int)$owner) return false; - + + if ($this->db->select($this->lists_table,'list_id',array( + 'list_name' => $name, + 'list_owner' => $owner, + ),__LINE__,__FILE__) && $this->db->next_record()) + { + return $this->db->f('list_id'); // return existing list-id + } if (!$this->db->insert($this->lists_table,array( 'list_name' => $name, 'list_owner' => $owner,