From 478c4ed7120b3fec25bb54378d0075968b553e73 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 17 Jun 2012 10:03:50 +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 689c170bb4..15fb3c5476 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -306,8 +306,6 @@ class addressbook_bo extends addressbook_so } $this->categories = new categories($this->user,'addressbook'); - $this->tracking = new addressbook_tracking($this); - $config = config::read('phpgwapi'); $this->delete_history = $config['history']; } @@ -765,6 +763,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); } } @@ -926,8 +925,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); } }