From f48b6c244f5f3da4d21da8cd0fb3b3e99c53cf60 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 17 Jun 2012 10:03:28 +0000 Subject: [PATCH] do NOT instanciate tracking class by default: it is only used for (seldome) updates and stalls updates in setup sometimes (1.6 update) --- addressbook/inc/class.addressbook_bo.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 0139ffce88..0f0a590611 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -308,8 +308,6 @@ class addressbook_bo extends addressbook_so } $this->categories = new categories($this->user,'addressbook'); - $this->tracking = new addressbook_tracking($this); - $this->delete_history = $GLOBALS['egw_info']['server']['history']; } @@ -766,6 +764,7 @@ class addressbook_bo extends addressbook_so if ($ok && $old['tid'] != addressbook_so::DELETED_TYPE) { $GLOBALS['egw']->contenthistory->updateTimeStamp('contacts', $id, 'delete', time()); + if (!isset($this->tracking)) $this->tracking = new addressbook_tracking($this); $this->tracking->track(array('id' => $id), array('id' => $id), null, true); } } @@ -927,8 +926,10 @@ class addressbook_bo extends addressbook_so } // Record change history for sql - doesn't work for LDAP accounts - if(!$contact['account_id'] || $contact['account_id'] && $this->account_repository == 'sql') { + if(!$contact['account_id'] || $contact['account_id'] && $this->account_repository == 'sql') + { $deleted = ($old['tid'] == addressbook_so::DELETED_TYPE || $contact['tid'] == addressbook_so::DELETED_TYPE); + if (!isset($this->tracking)) $this->tracking = new addressbook_tracking($this); $this->tracking->track($to_write, $old ? $old : null, null, $deleted); } }