From 55b0081103643eaf68c7a28ea29a41af86e84c2e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 2 Sep 2013 11:19:42 +0000 Subject: [PATCH] fixed not working delete-account hook --- addressbook/inc/class.addressbook_so.inc.php | 2 +- addressbook/inc/class.addressbook_sql.inc.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/addressbook/inc/class.addressbook_so.inc.php b/addressbook/inc/class.addressbook_so.inc.php index 233a2d2824..73f1f3e3a3 100755 --- a/addressbook/inc/class.addressbook_so.inc.php +++ b/addressbook/inc/class.addressbook_so.inc.php @@ -793,7 +793,7 @@ class addressbook_so { $this->somain->delete(array('owner' => $account_id)); // so_sql_cf::delete() takes care of cfs too - if(!($this->somain instanceof addressbook_sql)) + if(method_exists($this->somain, 'get_lists')) { $lists = $this->somain->get_lists($account_id); $this->somain->delete_list(array_keys($lists)); diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index e499cd66a3..306d1313f2 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -54,6 +54,8 @@ class addressbook_sql extends so_sql_cf */ var $ab2list_table = 'egw_addressbook2list'; + const EXTRA_TABLE = 'egw_addressbook_extra'; + /** * Constructor * @@ -61,7 +63,7 @@ class addressbook_sql extends so_sql_cf */ function __construct(egw_db $db=null) { - parent::__construct('phpgwapi','egw_addressbook','egw_addressbook_extra','contact_', + parent::__construct('phpgwapi', 'egw_addressbook', self::EXTRA_TABLE, 'contact_', $extra_key='_name',$extra_value='_value',$extra_id='_id',$db); // Get custom fields from addressbook instead of phpgwapi @@ -473,11 +475,11 @@ class addressbook_sql extends so_sql_cf ),__LINE__,__FILE__); // cfs - $this->db->update($this->soextra->table_name,array( - $this->extra_owner => $new_owner + $this->db->update(self::EXTRA_TABLE, array( + 'contact_owner' => $new_owner ),array( - $this->extra_owner => $account_id - ),__LINE__,__FILE__); + 'contact_owner' => $account_id + ), __LINE__, __FILE__); // lists $this->db->update($this->lists_table, array(