diff --git a/phpgwapi/inc/class.historylog.inc.php b/phpgwapi/inc/class.historylog.inc.php index 37145f5814..bb987170ce 100644 --- a/phpgwapi/inc/class.historylog.inc.php +++ b/phpgwapi/inc/class.historylog.inc.php @@ -42,9 +42,16 @@ { $appname = $GLOBALS['egw_info']['flags']['currentapp']; } - $this->appname = $appname; - $this->db = clone($GLOBALS['egw']->db); + + if (is_object($GLOBALS['egw_setup']->db)) + { + $this->db = clone($GLOBALS['egw_setup']->db); + } + else + { + $this->db = clone($GLOBALS['egw']->db); + } $this->db->set_app('phpgwapi'); }